summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorseth <[email protected]>2023-05-27 18:36:55 -0400
committerseth <[email protected]>2023-05-27 18:36:55 -0400
commitbdbb8bd1012942d55e5322e16dce2912f79a0b9c (patch)
treead2415a30470d391bd1d035deacd29732bc5d8d2
parent9c4eefcf057a680debbe05cef4fcd647bdf937f2 (diff)
actions: use composite action for updating inputs
-rw-r--r--.github/actions/flake-update/action.yaml33
-rw-r--r--.github/workflows/update-inputs.yaml16
-rw-r--r--.github/workflows/update-nixpkgs.yaml16
3 files changed, 39 insertions, 26 deletions
diff --git a/.github/actions/flake-update/action.yaml b/.github/actions/flake-update/action.yaml
new file mode 100644
index 0000000..f26c383
--- /dev/null
+++ b/.github/actions/flake-update/action.yaml
@@ -0,0 +1,33 @@
+name: "update flake inputs"
+description: "wrapper around DeterminateSystems/update-flake-lock"
+inputs:
+ update-token:
+ description: "github write token for creating prs"
+ required: true
+ github-token:
+ description: "github read token for avoid rate limits"
+ required: false
+ default: ""
+ inputs:
+ description: "flake inputs to update"
+ required: false
+ default: ""
+ commit-msg:
+ required: true
+runs:
+ using: "composite"
+ steps:
+ - uses: cachix/install-nix-action@v20
+ with:
+ github_access_token: ${{ inputs.github-token }}
+
+ - uses: DeterminateSystems/update-flake-lock@v19
+ with:
+ commit-msg: ${{ inputs.commit-msg }}
+ pr-title: ${{ inputs.commit-msg }}
+ pr-body: |
+ Automated changes by the [update-flake-lock](https://github.com/DeterminateSystems/update-flake-lock) GitHub Action.
+
+ bors r+
+ nix-options: "--accept-flake-config"
+ token: ${{ inputs.update-token }}
diff --git a/.github/workflows/update-inputs.yaml b/.github/workflows/update-inputs.yaml
index 8dc66c4..59fed45 100644
--- a/.github/workflows/update-inputs.yaml
+++ b/.github/workflows/update-inputs.yaml
@@ -16,19 +16,9 @@ jobs:
- name: checkout repo
uses: actions/checkout@v3
- - name: install nix
- uses: cachix/install-nix-action@v20
- with:
- github_access_token: ${{ secrets.GITHUB_TOKEN }}
-
- name: update all inputs
- uses: DeterminateSystems/update-flake-lock@v19
+ uses: ./.github/actions/flake-update
with:
commit-msg: "flake: update all inputs"
- pr-title: "flake: update all inputs"
- pr-body: |
- Automated changes by the [update-flake-lock](https://github.com/DeterminateSystems/update-flake-lock) GitHub Action.
-
- bors r+
- nix-options: "--accept-flake-config"
- token: ${{ secrets.FLAKE_UPDATE }}
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ update-token: ${{ secrets.FLAKE_UPDATE }}
diff --git a/.github/workflows/update-nixpkgs.yaml b/.github/workflows/update-nixpkgs.yaml
index e78d41b..ccb04d3 100644
--- a/.github/workflows/update-nixpkgs.yaml
+++ b/.github/workflows/update-nixpkgs.yaml
@@ -16,20 +16,10 @@ jobs:
- name: checkout repo
uses: actions/checkout@v3
- - name: install nix
- uses: cachix/install-nix-action@v20
- with:
- github_access_token: ${{ secrets.GITHUB_TOKEN }}
-
- name: update nixpkgs inputs
- uses: DeterminateSystems/update-flake-lock@v19
+ uses: ./.github/actions/flake-update
with:
inputs: nixpkgs nixpkgs-stable
commit-msg: "flake: update nixpkgs inputs"
- pr-title: "flake: update nixpkgs inputs"
- pr-body: |
- Automated changes by the [update-flake-lock](https://github.com/DeterminateSystems/update-flake-lock) GitHub Action.
-
- bors r+
- nix-options: "--accept-flake-config"
- token: ${{ secrets.FLAKE_UPDATE }}
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ update-token: ${{ secrets.FLAKE_UPDATE }}