name: Preview Updater on: workflow_call: inputs: token: type: string required: false default: '' config: type: string description: Path to the preview configuration YAML file. required: false default: '' readme: type: string description: Specifies the path to the README file. required: false default: '' concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true permissions: contents: write pull-requests: write jobs: Update: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - name: Update banner uses: TheDragonCode/github-preview-updater@v2 id: preview with: token: ${{ inputs.token || secrets.GITHUB_TOKEN }} config: ${{ inputs.config }} readme: ${{ inputs.readme }} - name: Merge PR if: steps.preview.outputs.pullRequestNumber != '' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: gh pr merge --merge --delete-branch ${{ steps.preview.outputs.pullRequestNumber }}