Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compliant Updates #56

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Compliant Updates #56

wants to merge 6 commits into from

Conversation

nyarly
Copy link

@nyarly nyarly commented Oct 29, 2022

Description

Optionally allow commits and PRs to be made using a token.
Documents how to use this to get verified commits and PRs that trigger further actions.

Checklist
  • Tested functionality against a test repository (see "How to test changes")
  • Added or updated relevant documentation (leave unchecked if not applicable)

@nyarly
Copy link
Author

nyarly commented Nov 4, 2022

@cole-h updated based on CI

Copy link
Member

@cole-h cole-h left a comment

Choose a reason for hiding this comment

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

Hey there, sorry it took me so long to get back to you! I was doing a bit of playing around with your approach, and I was able to find a slightly better approach.

@@ -119,6 +123,36 @@ runs:
TARGETS: ${{ inputs.inputs }}
COMMIT_MSG: ${{ inputs.commit-msg }}
PATH_TO_FLAKE_DIR: ${{ inputs.path-to-flake-dir }}
COMMIT_WITH_TOKEN: ${{ inputs.commit-with-token }}

- name: Commit changes
Copy link
Member

Choose a reason for hiding this comment

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

Rather than dealing with the "get a verified-by-github commit" ourselves, I would much rather call out to an action or two that do this for us. And it just so happens that there is a combination of actions we can use to get the same result:

      - name: Create branch for ${{ inputs.branch }}
        if: ${{ inputs.commit-with-token == 'true' }}
        uses: peterjgrainger/[email protected]
        env:
          GITHUB_TOKEN: ${{ inputs.token }}
        with:
          branch: refs/heads/${{ inputs.branch }}
      - name: Create GitHub-verified commit
        if: ${{ inputs.commit-with-token == 'true' }}
        uses: swinton/[email protected]
        env:
          GH_TOKEN: ${{ inputs.token }}
        with:
          files: |
            flake.lock
          commit-message: ${{ inputs.commit-msg }}
          ref: refs/heads/${{ inputs.branch }}

You can see it works here: cole-h/test#7.

Copy link
Author

Choose a reason for hiding this comment

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

Let me try this on my fork

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
nyarly and others added 2 commits June 6, 2023 14:52
Co-authored-by: Cole Helbling <[email protected]>
Co-authored-by: Cole Helbling <[email protected]>
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.

2 participants