Open
Conversation
Author
|
@cole-h updated based on CI |
cole-h
reviewed
Nov 8, 2022
Member
cole-h
left a comment
There was a problem hiding this comment.
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 |
Member
There was a problem hiding this comment.
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.
Co-authored-by: Cole Helbling <cole.e.helbling@outlook.com>
Co-authored-by: Cole Helbling <cole.e.helbling@outlook.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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