Skip to content

Commit 8f451ad

Browse files
committed
Allow manual triggering with a specific environment
1 parent 9862f08 commit 8f451ad

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

.github/workflows/main.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
on:
23
push:
34
branches:
@@ -6,11 +7,18 @@ on:
67
merge_group:
78
schedule:
89
- cron: '0 0 * * *' # Every day at midnight UTC
9-
10+
# allow manual triggering with a given environment
11+
workflow_dispatch:
12+
inputs:
13+
ENVIRONMENT:
14+
required: true
15+
type: environment
1016
name: CI
1117
jobs:
1218

1319
test:
20+
environment:
21+
name: ${{ vars.ENVIRONMENT }}
1422
runs-on: ubuntu-latest
1523
steps:
1624
- name: Check out source code
@@ -34,6 +42,8 @@ jobs:
3442
run: pdm run test-docs
3543

3644
license:
45+
environment:
46+
name: ${{ vars.ENVIRONMENT}}
3747
runs-on: ubuntu-latest
3848
steps:
3949
- name: Check out source code
@@ -48,5 +58,7 @@ jobs:
4858
with:
4959
CHIPFLOW_API_ORIGIN: ${{ vars.CHIPFLOW_API_ORIGIN }}
5060
CHIPFLOW_BACKEND_VERSION: ${{ vars.CHIPFLOW_BACKEND_VERSION }}
61+
ENVIRONMENT: ${{ vars.ENVIRONMENT }}
5162
secrets:
5263
CHIPFLOW_API_KEY: ${{ secrets.CHIPFLOW_API_KEY}}
64+

.github/workflows/test-examples.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@ on:
88
inputs:
99
CHIPFLOW_API_ORIGIN:
1010
required: true
11+
type: string
1112
CHIPFLOW_BACKEND_VERSION:
1213
required: true
14+
type: string
15+
ENVIRONMENT:
16+
required: true
17+
type: environment
1318

1419

1520
jobs:
@@ -24,7 +29,7 @@ jobs:
2429
env:
2530
DRY: ${{ matrix.dry && '--dry-run' || '' }}
2631
is_dry: ${{ matrix.dry && '(dry run)' || '' }}
27-
our_path: "${{ github.workspace}}/${{ github.repo }}"
32+
our_path: ${{ github.workspace}}
2833
test_repo_path: "${{ github.workspace }}/${{ matrix.repo.name }}"
2934

3035
name: ${{ matrix.dry && 'Test Submit - Dry run' || 'Test submit' }}
@@ -45,20 +50,23 @@ jobs:
4550
id: check-head-ref
4651
working-directory: ${{ env.test_repo_path }}
4752
if: github.event_name == 'pull_request'
53+
env:
54+
HEAD_REF: ${{ github.head_ref }}
55+
BASE_REF: ${{ github.base_ref }}
4856
run: |
4957
git remote update
50-
if git checkout ${{ github.head_ref }}; then
51-
echo "Using branch ${{github.head_ref}}"
58+
if git checkout $HEAD_REF; then
59+
echo "Using branch $HEAD_REF"
5260
echo "found-branch=1\n" >> $GITHUB_OUTPUT
5361
else
54-
echo "${{github.head_ref}} not found, checking base ${{github.base_ref}}"
62+
echo "$HEAD_REF not found, checking base $BASE_REF"
5563
echo "found-branch=0\n" >> $GITHUB_OUTPUT
5664
fi
5765
5866
- name: Check for branch ${{ github.base_ref }}
5967
id: check-base-ref
6068
working-directory: ${{ env.test_repo_path }}x
61-
if: github.event_name == 'pull_request' && steps.check-head-ref == 0
69+
if: github.event_name == 'pull_request' && steps.check-head-ref.outputs.found-branch == '0'
6270
run: |
6371
git remote update
6472
if git checkout ${{ github.base_ref }}; then

0 commit comments

Comments
 (0)