Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
a0c5484d59 | |||
aa092a7430 | |||
913da8731c | |||
867efeb864 | |||
5e50e4bcfb |
58
README.md
58
README.md
@ -125,6 +125,37 @@ jobs:
|
|||||||
path-to-flake-dir: 'nix/' # in this example our flake doesn't sit at the root of the repository, it sits under 'nix/flake.nix'
|
path-to-flake-dir: 'nix/' # in this example our flake doesn't sit at the root of the repository, it sits under 'nix/flake.nix'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Example using a different Git user
|
||||||
|
|
||||||
|
If you want to change the author and / or committer of the flake.lock update commit, you can tweak the `git-{author,committer}-{name,email}` options:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: update-flake-lock
|
||||||
|
on:
|
||||||
|
workflow_dispatch: # allows manual triggering
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * 0' # runs weekly on Sunday at 00:00
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lockfile:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Install Nix
|
||||||
|
uses: cachix/install-nix-action@v16
|
||||||
|
with:
|
||||||
|
extra_nix_config: |
|
||||||
|
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- name: Update flake.lock
|
||||||
|
uses: DeterminateSystems/update-flake-lock@vX
|
||||||
|
with:
|
||||||
|
git-author-name: 'Jane Author'
|
||||||
|
git-author-email: 'github-actions[bot]@users.noreply.github.com'
|
||||||
|
git-committer-name: 'John Committer'
|
||||||
|
git-committer-email: 'github-actions[bot]@users.noreply.github.com'
|
||||||
|
```
|
||||||
|
|
||||||
## Running GitHub Actions CI
|
## Running GitHub Actions CI
|
||||||
|
|
||||||
GitHub Actions will not run workflows when a branch is pushed by or a PR is opened by a GitHub Action. There are two ways to have GitHub Actions CI run on a PR submitted by this action.
|
GitHub Actions will not run workflows when a branch is pushed by or a PR is opened by a GitHub Action. There are two ways to have GitHub Actions CI run on a PR submitted by this action.
|
||||||
@ -238,6 +269,33 @@ However you can customize it, with variable interpolation performed with [Handle
|
|||||||
- env.GIT_COMMITTER_EMAIL
|
- env.GIT_COMMITTER_EMAIL
|
||||||
- env.GIT_COMMIT_MESSAGE
|
- env.GIT_COMMIT_MESSAGE
|
||||||
|
|
||||||
|
## Add assignees or reviewers
|
||||||
|
|
||||||
|
You can assign the PR to or request a review from one or more GitHub users with `pr-assignees` and `pr-reviewers`, respectively.
|
||||||
|
These properties expect a comma or newline separated list of GitHub usernames:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: update-flake-lock
|
||||||
|
on:
|
||||||
|
workflow_dispatch: # allows manual triggering
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * 1,4' # Run twice a week
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lockfile:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Install Nix
|
||||||
|
uses: cachix/install-nix-action@v16
|
||||||
|
- name: Update flake.lock
|
||||||
|
uses: DeterminateSystems/update-flake-lock@vX
|
||||||
|
with:
|
||||||
|
pr-assignees: SomeGitHubUsername
|
||||||
|
pr-reviewers: SomeOtherGitHubUsername,SomeThirdGitHubUsername
|
||||||
|
```
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
Feel free to send a PR or open an issue if you find something functions unexpectedly! Please make sure to test your changes and update any related documentation before submitting your PR.
|
Feel free to send a PR or open an issue if you find something functions unexpectedly! Please make sure to test your changes and update any related documentation before submitting your PR.
|
||||||
|
34
action.yml
34
action.yml
@ -53,6 +53,30 @@ inputs:
|
|||||||
description: 'A comma or newline separated list of labels to set on the Pull Request to be created'
|
description: 'A comma or newline separated list of labels to set on the Pull Request to be created'
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
|
pr-assignees:
|
||||||
|
description: 'A comma or newline separated list of assignees (GitHub usernames).'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
pr-reviewers:
|
||||||
|
description: 'A comma or newline separated list of reviewers (GitHub usernames) to request a review from.'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
git-author-name:
|
||||||
|
description: 'Author name used for commit. Only used if sign-commits is false.'
|
||||||
|
required: false
|
||||||
|
default: 'github-actions[bot]'
|
||||||
|
git-author-email:
|
||||||
|
description: 'Author email used for commit. Only used if sign-commits is false.'
|
||||||
|
required: false
|
||||||
|
default: 'github-actions[bot]@users.noreply.github.com'
|
||||||
|
git-committer-name:
|
||||||
|
description: 'Committer name used for commit. Only used if sign-commits is false.'
|
||||||
|
required: false
|
||||||
|
default: 'github-actions[bot]'
|
||||||
|
git-committer-email:
|
||||||
|
description: 'Committer email used for commit. Only used if sign-commits is false.'
|
||||||
|
required: false
|
||||||
|
default: 'github-actions[bot]@users.noreply.github.com'
|
||||||
sign-commits:
|
sign-commits:
|
||||||
description: 'Set to true if the action should sign the commit with GPG'
|
description: 'Set to true if the action should sign the commit with GPG'
|
||||||
required: false
|
required: false
|
||||||
@ -104,10 +128,10 @@ runs:
|
|||||||
if: ${{ inputs.sign-commits != 'true' }}
|
if: ${{ inputs.sign-commits != 'true' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
echo "GIT_AUTHOR_NAME=github-actions[bot]" >> $GITHUB_ENV
|
echo "GIT_AUTHOR_NAME=${{ inputs.git-author-name }}" >> $GITHUB_ENV
|
||||||
echo "GIT_AUTHOR_EMAIL=<github-actions[bot]@users.noreply.github.com>" >> $GITHUB_ENV
|
echo "GIT_AUTHOR_EMAIL=<${{ inputs.git-author-email }}>" >> $GITHUB_ENV
|
||||||
echo "GIT_COMMITTER_NAME=github-actions[bot]" >> $GITHUB_ENV
|
echo "GIT_COMMITTER_NAME=${{ inputs.git-committer-name }}" >> $GITHUB_ENV
|
||||||
echo "GIT_COMMITTER_EMAIL=<github-actions[bot]@users.noreply.github.com>" >> $GITHUB_ENV
|
echo "GIT_COMMITTER_EMAIL=<${{ inputs.git-committer-email }}>" >> $GITHUB_ENV
|
||||||
- name: Run update-flake-lock.sh
|
- name: Run update-flake-lock.sh
|
||||||
run: $GITHUB_ACTION_PATH/update-flake-lock.sh
|
run: $GITHUB_ACTION_PATH/update-flake-lock.sh
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -160,5 +184,7 @@ runs:
|
|||||||
author: ${{ env.GIT_AUTHOR_NAME }} ${{ env.GIT_AUTHOR_EMAIL }}
|
author: ${{ env.GIT_AUTHOR_NAME }} ${{ env.GIT_AUTHOR_EMAIL }}
|
||||||
title: ${{ inputs.pr-title }}
|
title: ${{ inputs.pr-title }}
|
||||||
token: ${{ inputs.token }}
|
token: ${{ inputs.token }}
|
||||||
|
assignees: ${{ inputs.pr-assignees }}
|
||||||
labels: ${{ inputs.pr-labels }}
|
labels: ${{ inputs.pr-labels }}
|
||||||
|
reviewers: ${{ inputs.pr-reviewers }}
|
||||||
body: ${{ steps.pr_body.outputs.contents }}
|
body: ${{ steps.pr_body.outputs.contents }}
|
||||||
|
Reference in New Issue
Block a user