Skip to content

Compliant Updates#56

Open
nyarly wants to merge 9 commits intoDeterminateSystems:mainfrom
nyarly:main
Open

Compliant Updates#56
nyarly wants to merge 9 commits intoDeterminateSystems:mainfrom
nyarly:main

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.

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/action-create-branch@v2.2.0
        env:
          GITHUB_TOKEN: ${{ inputs.token }}
        with:
          branch: refs/heads/${{ inputs.branch }}
      - name: Create GitHub-verified commit
        if: ${{ inputs.commit-with-token == 'true' }}
        uses: swinton/commit@v2.0.0
        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

nyarly and others added 2 commits June 6, 2023 14:52
Co-authored-by: Cole Helbling <cole.e.helbling@outlook.com>
Co-authored-by: Cole Helbling <cole.e.helbling@outlook.com>
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