Skip to content

Commit ccff3ea

Browse files
committed
update the actions
1 parent e609db7 commit ccff3ea

File tree

2 files changed

+15
-20
lines changed

2 files changed

+15
-20
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
name: Continuous Integration
2-
on:
3-
pull_request:
4-
push:
5-
branches: [dev]
6-
2+
on: pull_request
73
jobs:
4+
85
module:
96
name: Module build
107
runs-on: ubuntu-latest

.github/workflows/release.yml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,21 @@ on:
1818
# Only run the workflow when a PR is updated or when a developer explicitly requests
1919
# a build by sending a 'firebase_build' event.
2020
pull_request:
21-
types: [opened, synchronize]
21+
types: [opened, synchronize, closed]
2222

2323
repository_dispatch:
2424
types:
2525
- firebase_build
2626

27-
# Run the release candidate action when code is pushed to dev and only if firebase.go is changed
28-
push:
29-
branches:
30-
- dev
31-
paths:
32-
- 'firebase.go'
33-
3427
jobs:
3528
stage_release:
3629
# To publish a release, merge the release PR with the label 'release:publish'.
3730
# To stage a release without publishing it, send a 'firebase_build' event or apply
3831
# the 'release:stage' label to a PR.
3932
if: github.event.action == 'firebase_build' ||
4033
contains(github.event.pull_request.labels.*.name, 'release:stage') ||
41-
(github.event_name == 'push' && github.ref == 'refs/heads/dev' &&
42-
startsWith(github.event.head_commit.message, '[chore] Release '))
34+
(github.event.pull_request.merged &&
35+
contains(github.event.pull_request.labels.*.name, 'release:publish'))
4336

4437
runs-on: ubuntu-latest
4538

@@ -68,20 +61,25 @@ jobs:
6861
publish_release:
6962
needs: stage_release
7063

71-
# Run this ONLY when code is pushed/merged to dev
72-
# This automatically satisfies the 'Release' environment protection
73-
if: github.event_name == 'push' && github.ref == 'refs/heads/dev' &&
74-
startsWith(github.event.head_commit.message, '[chore] Release ')
64+
# Check whether the release should be published. We publish only when the trigger PR is
65+
# 1. merged
66+
# 2. to the dev branch
67+
# 3. with the label 'release:publish', and
68+
# 4. the title prefix '[chore] Release '.
69+
if: github.event.pull_request.merged &&
70+
github.ref == 'refs/heads/dev' &&
71+
contains(github.event.pull_request.labels.*.name, 'release:publish') &&
72+
startsWith(github.event.pull_request.title, '[chore] Release ')
7573

7674
runs-on: ubuntu-latest
77-
environment: Release
7875
permissions:
7976
pull-requests: write
8077

8178
steps:
8279
- name: Checkout source for publish
8380
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
8481
with:
82+
ref: dev
8583
persist-credentials: false
8684
fetch-depth: 0
8785

0 commit comments

Comments
 (0)