Skip to content

Commit a24a615

Browse files
authored
chore: Add workflow for deleting Firebase Hosting channels on PR closure (#70)
- Added `.github/workflows/delete-firebase-hosting-channel.yml`: - Automatically deletes Firebase Hosting preview channels when a pull request is closed. - Uses `w9jds/firebase-action` pinned to v13.27.0 for stability. - Updated Firebase Hosting workflows to pin action versions for consistency: - `actions/checkout` pinned to v4.2.2. - `actions/setup-node` pinned to v4.1.0. - `actions/cache` pinned to v4.1.2. - `FirebaseExtended/action-hosting-deploy` pinned to v0.9.0. - Ensures reproducibility and stability across workflows.
1 parent e264750 commit a24a615

File tree

3 files changed

+25
-8
lines changed

3 files changed

+25
-8
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: On PR closed - Delete firebase hosting channel
2+
on:
3+
pull_request:
4+
types:
5+
- closed
6+
jobs:
7+
delete_firebase_channel:
8+
runs-on: ubuntu-24.04
9+
timeout-minutes: 10
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: w9jds/firebase-action@818980820c18bcd6a2e3e4739c6fe174ce5b467f # v13.27.0
13+
with:
14+
args: hosting:channel:delete ${{ github.head_ref }} --force
15+
env:
16+
GCP_SA_KEY: ${{ secrets.FIREBASE_SERVICE_ACCOUNT_BVARGA_FE600 }}
17+
PROJECT_ID: bvarga-fe600

.github/workflows/firebase-hosting-merge.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ jobs:
1111
name: production
1212
url: https://bvarga.dev
1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1515
- name: Use Node.js
16-
uses: actions/setup-node@v4
16+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
1717
with:
1818
node-version-file: '.node-version'
1919
- name: Cache node modules
20-
uses: actions/cache@v4
20+
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
2121
env:
2222
cache-name: cache-node-modules
2323
with:
2424
path: node_modules
2525
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
2626
- name: Build and Test
2727
run: ./scripts/build.sh
28-
- uses: FirebaseExtended/action-hosting-deploy@v0
28+
- uses: FirebaseExtended/action-hosting-deploy@0cbcac4740c2bfb00d632f0b863b57713124eb5a # v0.9.0
2929
with:
3030
repoToken: '${{ secrets.GITHUB_TOKEN }}'
3131
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_BVARGA_FE600 }}'

.github/workflows/firebase-hosting-pull-request.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ jobs:
99
runs-on: ubuntu-24.04
1010
environment: staging
1111
steps:
12-
- uses: actions/checkout@v4
12+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1313
- name: Use Node.js
14-
uses: actions/setup-node@v4
14+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
1515
with:
1616
node-version-file: '.node-version'
1717
- name: Cache node modules
18-
uses: actions/cache@v4
18+
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
1919
env:
2020
cache-name: cache-node-modules
2121
with:
2222
path: node_modules
2323
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
2424
- name: Build and Test
2525
run: ./scripts/build.sh
26-
- uses: FirebaseExtended/action-hosting-deploy@v0
26+
- uses: FirebaseExtended/action-hosting-deploy@0cbcac4740c2bfb00d632f0b863b57713124eb5a # v0.9.0
2727
with:
2828
repoToken: '${{ secrets.GITHUB_TOKEN }}'
2929
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_BVARGA_FE600 }}'

0 commit comments

Comments
 (0)