mirror of
https://github.com/taiki-e/install-action.git
synced 2026-04-21 15:10:27 +00:00
ci: Use taiki-e/github-actions/.github/workflows/gen.yml reusable workflow
This commit is contained in:
55
.github/workflows/manifest.yml
vendored
55
.github/workflows/manifest.yml
vendored
@@ -33,47 +33,18 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
manifest:
|
manifest:
|
||||||
runs-on: ubuntu-latest
|
uses: taiki-e/github-actions/.github/workflows/gen.yml@main
|
||||||
timeout-minutes: 60
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
pull-requests: write # for gh pr review --approve
|
pull-requests: write # for gh pr edit --add-assignee / gh pr review --approve
|
||||||
steps:
|
repository-projects: read # for gh pr edit --add-assignee
|
||||||
- uses: taiki-e/checkout-action@v1
|
secrets: inherit
|
||||||
- uses: taiki-e/github-actions/install-rust@stable
|
with:
|
||||||
- name: Generate Cargo.lock
|
script: tools/manifest.sh
|
||||||
run: cargo update
|
commit-script: tools/ci/manifest.sh
|
||||||
- uses: Swatinem/rust-cache@v2
|
title: Update manifest
|
||||||
with:
|
branch: update-manifest
|
||||||
cache-all-crates: 'true'
|
automerge: true
|
||||||
- run: tools/manifest.sh
|
install-rust: true
|
||||||
env:
|
rust: stable
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
rust-cache: true
|
||||||
- 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')
|
|
||||||
|
|||||||
Reference in New Issue
Block a user