|
1 | 1 | name: refresh release artifacts |
2 | 2 |
|
3 | 3 | on: |
4 | | - pull_request_target: |
| 4 | + pull_request: |
5 | 5 | types: |
6 | 6 | - opened |
7 | 7 | - reopened |
8 | 8 | - synchronize |
9 | 9 | branches: |
10 | 10 | - main |
| 11 | + push: |
| 12 | + branches: |
| 13 | + - release-please--branches--main |
11 | 14 |
|
12 | 15 | permissions: |
13 | | - contents: write |
14 | | - pull-requests: write |
| 16 | + contents: read |
15 | 17 |
|
16 | 18 | concurrency: |
17 | | - group: release-artifacts-${{ github.event.pull_request.number }} |
| 19 | + group: release-artifacts-${{ github.event.pull_request.number || github.ref }} |
18 | 20 | cancel-in-progress: true |
19 | 21 |
|
20 | 22 | jobs: |
21 | | - refresh-generated-artifacts: |
22 | | - if: github.event.pull_request.head.repo.full_name == github.repository && startsWith(github.event.pull_request.head.ref, 'release-please--branches--') |
| 23 | + verify-generated-artifacts: |
| 24 | + if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && startsWith(github.event.pull_request.head.ref, 'release-please--branches--') |
23 | 25 | runs-on: ubuntu-latest |
24 | 26 |
|
25 | 27 | steps: |
|
52 | 54 | make openapi |
53 | 55 | make openapi-client |
54 | 56 |
|
| 57 | + - name: Assert generated artifacts are current |
| 58 | + run: git diff --exit-code -- public/openapi.yaml frontend/src/api/generated |
| 59 | + |
| 60 | + refresh-generated-artifacts: |
| 61 | + if: github.event_name == 'push' && github.repository == 'html2rss/html2rss-web' && github.ref == 'refs/heads/release-please--branches--main' |
| 62 | + runs-on: ubuntu-latest |
| 63 | + permissions: |
| 64 | + contents: write |
| 65 | + |
| 66 | + steps: |
| 67 | + - uses: actions/checkout@v6 |
| 68 | + with: |
| 69 | + ref: ${{ github.ref_name }} |
| 70 | + fetch-depth: 0 |
| 71 | + |
| 72 | + - uses: ruby/setup-ruby@v1 |
| 73 | + with: |
| 74 | + bundler-cache: true |
| 75 | + |
| 76 | + - name: Setup pnpm |
| 77 | + uses: pnpm/action-setup@v6 |
| 78 | + with: |
| 79 | + cache: true |
| 80 | + cache_dependency_path: frontend/pnpm-lock.yaml |
| 81 | + package_json_file: frontend/package.json |
| 82 | + |
| 83 | + - uses: actions/setup-node@v6 |
| 84 | + with: |
| 85 | + node-version-file: ".tool-versions" |
| 86 | + |
| 87 | + - name: Install frontend dependencies |
| 88 | + run: pnpm install --frozen-lockfile |
| 89 | + working-directory: frontend |
| 90 | + |
| 91 | + - name: Refresh OpenAPI artifacts |
| 92 | + run: | |
| 93 | + make openapi |
| 94 | + make openapi-client |
| 95 | +
|
55 | 96 | - name: Commit generated artifacts |
56 | 97 | run: | |
57 | 98 | if git diff --quiet -- public/openapi.yaml frontend/src/api/generated; then |
|
0 commit comments