mirror of
https://github.com/taiki-e/install-action.git
synced 2026-04-16 19:42:37 +08:00
Extract install-action-manifest-schema and publish to crates-io (#657)
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> Co-authored-by: Taiki Endo <te316e89@gmail.com>
This commit is contained in:
51
.github/workflows/manifest_sync.yml
vendored
Normal file
51
.github/workflows/manifest_sync.yml
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
name: Manifest Synchronization
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [released]
|
||||
|
||||
env:
|
||||
WORKSPACE: /tmp/workspace
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash --noprofile --norc -CeEuxo pipefail {0}
|
||||
|
||||
jobs:
|
||||
sync:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: true
|
||||
|
||||
- name: Checkout manifest-schema branch
|
||||
run: ./tools/ci/checkout-manifest-schema-branch.sh "${WORKSPACE}"
|
||||
|
||||
- name: Copy over schema
|
||||
run: cp -- ./manifests/* "${WORKSPACE}"
|
||||
|
||||
- name: Stage changes
|
||||
working-directory: ${{ env.WORKSPACE }}
|
||||
run: git add .
|
||||
|
||||
- name: Show diff
|
||||
working-directory: ${{ env.WORKSPACE }}
|
||||
run: git diff HEAD
|
||||
|
||||
- name: Detect changes
|
||||
id: changes
|
||||
working-directory: ${{ env.WORKSPACE }}
|
||||
run: |
|
||||
# This output boolean tells us if the dependencies have actually changed
|
||||
printf "count=%s\n" "$(git status --porcelain=v1 | wc -l)" >>"${GITHUB_OUTPUT}"
|
||||
|
||||
- name: Commit and push
|
||||
# Only push if changes exist
|
||||
if: steps.changes.outputs.count > 0
|
||||
working-directory: ${{ env.WORKSPACE }}
|
||||
run: |
|
||||
git commit -m "Update manifest schema" && git push origin HEAD
|
||||
Reference in New Issue
Block a user