Skip to content

ci: add ref name check #9

ci: add ref name check

ci: add ref name check #9

Workflow file for this run

name: auto-approve
on:
pull_request:
branches:
- main
pull_request_target:
branches:
- bot-auto-update-registry
jobs:
commit-changes:
name: Commit Changes
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]' && github.ref_name == 'bot-auto-update-registry'
steps:
- name: add automerge label
uses: actions-ecosystem/action-add-labels@v1
with:
labels: automerge
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Automated Registry Update
file_pattern: '*.json'
disable_globbing: true
approve:
name: 'Auto Approve PR'
runs-on: ubuntu-latest
needs: commit-changes
permissions:
pull-requests: write
steps:
- uses: hmarr/auto-approve-action@v3
with:
review-message: 'Auto approved PR'
github-token: ${{ secrets.GITHUB_TOKEN }}
automerge:
name: 'Auto Merge PR'
runs-on: ubuntu-latest
needs: approve
steps:
- id: automerge
name: automerge
uses: "pascalgn/[email protected]"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
MERGE_METHOD: "squash"
MERGE_COMMIT_MESSAGE: "chore: scheduled registry update"
MERGE_RETRY_SLEEP: "10000"
MERGE_REQUIRED_APPROVALS: "0"
delete-latest-release:
permissions:
contents: write
name: "Remove Latest Release"
runs-on: "ubuntu-latest"
needs: automerge
steps:
- uses: dev-drprasad/[email protected] # PRERELEASE is v1.0 and can also be used to test and give us feedback
with:
tag_name: latest #(required) tag name to delete
github_token: ${{ secrets.GITHUB_TOKEN }} # (required) a GitHub token with write access to the repo that needs to be modified
delete_release: true #(optional) default: true
publish-latest-release:
permissions:
contents: write
name: "Github Release"
runs-on: "ubuntu-latest"
needs: delete-latest-release
steps:
- uses: actions/checkout@v3
- uses: ncipollo/release-action@v1
with:
tag: "latest"
commit: "main"