ci: Use taiki-e/github-actions/.github/workflows/gen.yml reusable workflow

This commit is contained in:
Taiki Endo
2026-02-11 20:37:31 +09:00
parent d4422f254e
commit 0fca428425

View File

@@ -33,47 +33,18 @@ concurrency:
jobs:
manifest:
runs-on: ubuntu-latest
timeout-minutes: 60
uses: taiki-e/github-actions/.github/workflows/gen.yml@main
permissions:
contents: read
pull-requests: write # for gh pr review --approve
steps:
- uses: taiki-e/checkout-action@v1
- uses: taiki-e/github-actions/install-rust@stable
- name: Generate Cargo.lock
run: cargo update
- uses: Swatinem/rust-cache@v2
with:
cache-all-crates: 'true'
- run: tools/manifest.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Handle diff
id: diff
run: tools/ci/manifest.sh
if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event_name == 'push' && github.ref == 'refs/heads/main')
- run: git add -N . && git -c color.ui=always diff --exit-code
- id: create-pull-request
uses: peter-evans/create-pull-request@v8
with:
title: Update manifest
body: |
Auto-generated by CI using [create-pull-request](https://github.com/peter-evans/create-pull-request).
This will be auto-merged when CI has passed because this is an auto-generated PR in a defined format and is usually considered no additional review is required.
branch: update-manifest
token: ${{ secrets.CREATE_PR_TOKEN }}
if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event_name == 'push' && github.ref == 'refs/heads/main') && steps.diff.outputs.success == 'false'
- name: Enable auto-merge for auto-generated PR
run: gh pr merge --rebase --auto "${PR_NUMBER:?}"
env:
GITHUB_TOKEN: ${{ secrets.CREATE_PR_TOKEN }}
PR_NUMBER: ${{ steps.create-pull-request.outputs.pull-request-number }}
if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event_name == 'push' && github.ref == 'refs/heads/main') && steps.diff.outputs.success == 'false' && steps.create-pull-request.outputs.pull-request-operation == 'created'
- name: Approve auto-generated PR for auto-merge
run: gh pr review --approve "${PR_NUMBER:?}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ steps.create-pull-request.outputs.pull-request-number }}
if: github.repository_owner == 'taiki-e' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event_name == 'push' && github.ref == 'refs/heads/main') && steps.diff.outputs.success == 'false' && (steps.create-pull-request.outputs.pull-request-operation == 'created' || steps.create-pull-request.outputs.pull-request-operation == 'updated')
pull-requests: write # for gh pr edit --add-assignee / gh pr review --approve
repository-projects: read # for gh pr edit --add-assignee
secrets: inherit
with:
script: tools/manifest.sh
commit-script: tools/ci/manifest.sh
title: Update manifest
branch: update-manifest
automerge: true
install-rust: true
rust: stable
rust-cache: true