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

Sign commit generated by github action for kinto-admin update #557

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

alexcottner
Copy link
Contributor

Adjusting our github action workflow that updates kinto-admin. Making the request over the github API should result in a signed commit.

@alexcottner alexcottner marked this pull request as ready for review February 8, 2024 19:58
@alexcottner alexcottner requested a review from a team as a code owner February 8, 2024 19:58
echo "$LATEST_RELEASE" > kinto-admin/VERSION
SHA=$(git rev-parse $BRANCH_NAME:kinto-admin/VERSION)
CONTENT=$(base64 -i kinto-admin/VERSION)
gh api --method PUT /repos/:owner/:repo/contents/kinto-admin/VERSION \
Copy link
Contributor

Choose a reason for hiding this comment

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

Are the :owner and :repo placeholders magically interpolated somehow?

Copy link
Contributor Author

@alexcottner alexcottner Feb 8, 2024

Choose a reason for hiding this comment

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

When running in an action, this context should be set for us automatically. You can set it locally by doing gh repo set-default inside a git repo and you will see something like:

gh repo set-default 
Found only one known remote repo, mozilla/remote-settings on github.com.
✓ Set mozilla/remote-settings as the default repository for the current directory

If you're on a fork it'll ask you to pick which remote you want:

gh repo set-default 
This command sets the default remote repository to use when querying the
GitHub API for the locally cloned repository.

gh uses the default repository for things like:

 - viewing and creating pull requests
 - viewing and creating issues
 - viewing and creating releases
 - working with GitHub Actions
 - adding repository and environment secrets

? Which repository should be the default?  [Use arrows to move, type to filter]
  mozilla/remote-settings
> alexcottner/remote-settings

These merge fields fall into the magic category and I was going to hard-code them at first. But then this workflow isn't usable on forks, if the repo name ever changes, etc.

@alexcottner alexcottner merged commit 4f3932e into main Feb 8, 2024
8 of 9 checks passed
@alexcottner alexcottner deleted the sign-admin-update-pr branch February 8, 2024 21:33
@grahamalama
Copy link
Contributor

For posterity: this is related to #529

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants