|
1 | 1 | name: post-release-templates
|
2 | 2 |
|
3 | 3 | on:
|
4 |
| - # release: |
5 |
| - # types: |
6 |
| - # - published |
| 4 | + release: |
| 5 | + types: |
| 6 | + - published |
7 | 7 | workflow_dispatch:
|
8 | 8 | inputs:
|
9 | 9 | tag:
|
10 | 10 | description: 'Release tag to process (optional)'
|
11 | 11 | required: true
|
12 |
| - # default: '' |
13 | 12 |
|
14 | 13 | env:
|
15 | 14 | NODE_VERSION: 22.6.0
|
|
23 | 22 | permissions:
|
24 | 23 | contents: write
|
25 | 24 | pull-requests: write
|
| 25 | + env: |
| 26 | + POSTGRES_USER: postgres |
| 27 | + POSTGRES_PASSWORD: postgres |
| 28 | + POSTGRES_DB: payloadtests |
26 | 29 | steps:
|
27 | 30 | - name: Checkout
|
28 | 31 | uses: actions/checkout@v4
|
|
48 | 51 | psql "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@localhost:5432/$POSTGRES_DB" -c "CREATE ROLE runner SUPERUSER LOGIN;"
|
49 | 52 | psql "postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@localhost:5432/$POSTGRES_DB" -c "SELECT version();"
|
50 | 53 | echo "POSTGRES_URL=postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@localhost:5432/$POSTGRES_DB" >> $GITHUB_ENV
|
| 54 | + echo "DATABASE_URI=postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@localhost:5432/$POSTGRES_DB" >> $GITHUB_ENV |
51 | 55 |
|
52 | 56 | - name: Start MongoDB
|
53 | 57 | uses: supercharge/[email protected]
|
@@ -76,33 +80,20 @@ jobs:
|
76 | 80 | set -ex
|
77 | 81 | git config --global user.name "github-actions[bot]"
|
78 | 82 | git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
79 |
| - export BRANCH_NAME=chore/templates-${{ steps.determine_tag.outputs.release_tag }} |
80 |
| - git checkout -b $BRANCH_NAME |
81 |
| - git add -A |
82 | 83 |
|
83 |
| - # If no files have changed, exit early with success |
84 |
| - git diff --cached --quiet --exit-code && exit 0 |
| 84 | + git diff --name-only |
85 | 85 |
|
86 |
| - git commit -m "chore(templates): bump lockfiles after ${{ steps.determine_tag.outputs.release_tag }}" |
87 |
| - git push origin $BRANCH_NAME |
88 |
| - echo "committed=true" >> "$GITHUB_OUTPUT" |
| 86 | + export BRANCH_NAME=templates/bump-${{ steps.determine_tag.outputs.release_tag }} |
89 | 87 | echo "branch=$BRANCH_NAME" >> "$GITHUB_OUTPUT"
|
90 | 88 |
|
91 |
| - - name: Debug Branches |
92 |
| - run: | |
93 |
| - echo "Target Commitish: ${{ github.event.release.target_commitish }}" |
94 |
| - echo "Branch: ${{ steps.commit.outputs.branch }}" |
95 |
| - echo "Ref: ${{ github.ref }}" |
96 |
| -
|
97 | 89 | - name: Create pull request
|
98 | 90 | uses: peter-evans/create-pull-request@v7
|
99 |
| - if: steps.commit.outputs.committed == 'true' |
100 | 91 | with:
|
101 | 92 | token: ${{ secrets.GITHUB_TOKEN }}
|
102 | 93 | labels: 'area: templates'
|
103 | 94 | author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
|
104 |
| - commit-message: 'Automated update after release' |
| 95 | + commit-message: 'templates: bump templates for ${{ steps.determine_tag.outputs.release_tag }}' |
105 | 96 | branch: ${{ steps.commit.outputs.branch }}
|
106 |
| - base: ${{ github.event_name != 'workflow_dispatch' && github.event.release.target_commitish || github.ref }} |
107 |
| - title: 'chore(templates): bump lockfiles after ${{ steps.determine_tag.outputs.release_tag }}' |
108 |
| - body: 'Automated bump of template lockfiles after release ${{ steps.determine_tag.outputs.release_tag }}' |
| 97 | + base: main |
| 98 | + title: 'templates: bump for ${{ steps.determine_tag.outputs.release_tag }}' |
| 99 | + body: 'Automated bump of templates for ${{ steps.determine_tag.outputs.release_tag }}' |
0 commit comments