Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
Integrate selfup to update flake.lock and related CIs
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Feb 18, 2024
1 parent 83cb2fe commit db25658
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/bump-flake-lock-and-selfup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Bump flake.lock and related dependencies
on:
pull_request:
paths:
- '.github/workflows/bump-flake-lock-and-selfup.yml'
schedule:
# At 10:17 JST on day-of-month 1 and on Monday.
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
- cron: '17 1 1 * 1'
workflow_dispatch:

jobs:
bump:
uses: kachick/selfup/.github/workflows/reusable-bump-flake-lock-and-selfup.yml@action-v1
if: (github.event.sender.login == 'kachick') || (github.event_name != 'pull_request')
with:
dry-run: ${{ github.event_name == 'pull_request' }}
optional-run: |
nix develop --command bash -c 'node --version | tr -d v' > .node-version
# https://stackoverflow.com/q/34807971
git update-index -q --really-refresh
git diff-index --quiet HEAD || git commit -m 'Update .node-version' .node-version
secrets:
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: '20.8.0' # selfup { "regex": "\\d[^']+", "script": "node --version | tr -d v" }
node-version-file: '.node-version'
cache: npm
- run: npm ci --ignore-scripts
- run: npm run build
Expand All @@ -39,7 +39,7 @@ jobs:
submodules: recursive
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: '20.8.0' # selfup { "regex": "\\d[^']+", "script": "node --version | tr -d v" }
node-version-file: '.node-version'
cache: npm
- run: npm ci --ignore-scripts
- run: npm test
Expand All @@ -51,7 +51,7 @@ jobs:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: '20.8.0' # selfup { "regex": "\\d[^']+", "script": "node --version | tr -d v" }
node-version-file: '.node-version'
cache: npm
- run: npm ci --ignore-scripts
- name: Typecheck
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/merge-bot-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,18 @@ jobs:
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

# https://github.com/kachick/anylang-template/issues/51
selfup-runner:
timeout-minutes: 30
runs-on: ubuntu-latest
if: ${{ github.actor == 'selfup-runner[bot]' }}
steps:
- name: Wait other jobs
uses: kachick/wait-other-jobs@v2
timeout-minutes: 20
- name: Approve and merge
run: gh pr review --approve "$PR_URL" && gh pr merge --auto --delete-branch --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit db25658

Please sign in to comment.