Skip to content

Conversation

IsaacMilarky
Copy link
Collaborator

Add Edits From NPD Repo

Problem

Currently, we have issues with our contributors.yml workflow. We also do not have a default .gitleaks.toml file template that we include in the repositories that are generated.

Solution

In the contributors.yml file, use a personal access token in the checkout action to make sure that we are using a user that has push access to main. This way we can circumvent branch protections for the action.

Also, added a .gitleaks.toml file to all tiers as well as this repository. This file includes gitleaks regex patterns for common keys. It can and should be configured for different project types.

Copy link
Contributor

@sachin-panayil sachin-panayil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Collaborator

@natalialuzuriaga natalialuzuriaga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After resolving the secrets variable error, this should be good to go!

Another question: does the .gitleaks.toml file have to live in the root directory? Could this be moved to the .github directory?

id: contrib_list
uses: akhilmhdh/[email protected]
env:
{% raw %}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did some testing to create a new repo using cookiecutter and got the error below:

Unable to create file '.github/workflows/contributors.yml'
Error message: 'secrets' is undefined

I think it's cause we need to have the {% raw %} tags embedded between each secrets variable because cookiecutter interprets it as a variable as part of its context

Comment on lines -39 to -41
{% raw %}

GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
{% endraw %}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add raw tags

- name: Update COMMUNITY.md
run: |
{% raw %}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add raw tags

GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
{% endraw %}

GITHUB_TOKEN: ${{ secrets.PUSH_TO_PROTECTED_BRANCH }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add raw tags

Comment on lines -39 to -41
{% raw %}

GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
{% endraw %}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add raw tags

Comment on lines -60 to -62
{% raw %}
CONTRIBUTORS="${{ steps.get_contributors.outputs.contributors }}"
{% endraw %}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add raw tags

Comment on lines -28 to +31
{% raw %}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
{% endraw %}

GITHUB_TOKEN: ${{ secrets.PUSH_TO_PROTECTED_BRANCH }}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add raw tags

env:
{% raw %}

GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add raw tags

Comment on lines -60 to -62
{% raw %}
CONTRIBUTORS="${{ steps.get_contributors.outputs.contributors }}"
{% endraw %}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add raw tags

@natalialuzuriaga natalialuzuriaga changed the base branch from main to dev September 23, 2025 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants