Skip to content

Commit

Permalink
Don't use dynamic branch for ref check
Browse files Browse the repository at this point in the history
  • Loading branch information
baksetercx committed Aug 19, 2024
1 parent 8a54ab6 commit 382085f
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 25 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/example-build-deploy-dotnet-google.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ jobs:
contents: read
id-token: write
environment: dev
# Only on push to $default-branch
if: github.ref_name == "trunk"
# Only on push to trunk
if: github.ref == 'refs/heads/trunk'
steps:
- uses: 3lvia/core-github-actions-templates/deploy@trunk
with:
Expand All @@ -106,8 +106,8 @@ jobs:
contents: read
id-token: write
environment: test
# Only on push to $default-branch
if: github.ref_name == "trunk"
# Only on push to trunk
if: github.ref == 'refs/heads/trunk'
steps:
- uses: 3lvia/core-github-actions-templates/deploy@trunk
with:
Expand All @@ -129,8 +129,8 @@ jobs:
contents: read
id-token: write
environment: prod
# Only on push to $default-branch
if: github.ref_name == "trunk"
# Only on push to trunk
if: github.ref == 'refs/heads/trunk'
steps:
- uses: 3lvia/core-github-actions-templates/deploy@trunk
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/example-build-deploy-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ jobs:
contents: read
id-token: write
environment: dev
# Only on push to $default-branch
if: github.ref_name == "trunk"
# Only on push to trunk
if: github.ref == 'refs/heads/trunk'
steps:
- uses: 3lvia/core-github-actions-templates/deploy@trunk
with:
Expand All @@ -104,8 +104,8 @@ jobs:
contents: read
id-token: write
environment: test
# Only on push to $default-branch
if: github.ref_name == "trunk"
# Only on push to trunk
if: github.ref == 'refs/heads/trunk'
steps:
- uses: 3lvia/core-github-actions-templates/deploy@trunk
with:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/example-build-deploy-go-google.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ jobs:
contents: read
id-token: write
environment: dev
# Only on push to $default-branch
if: github.ref_name == "trunk"
# Only on push to trunk
if: github.ref == 'refs/heads/trunk'
steps:
- uses: 3lvia/core-github-actions-templates/deploy@trunk
with:
Expand All @@ -77,8 +77,8 @@ jobs:
contents: read
id-token: write
environment: test
# Only on push to $default-branch
if: github.ref_name == "trunk"
# Only on push to trunk
if: github.ref == 'refs/heads/trunk'
steps:
- uses: 3lvia/core-github-actions-templates/deploy@trunk
with:
Expand All @@ -100,8 +100,8 @@ jobs:
contents: read
id-token: write
environment: prod
# Only on push to $default-branch
if: github.ref_name == "trunk"
# Only on push to trunk
if: github.ref == 'refs/heads/trunk'
steps:
- uses: 3lvia/core-github-actions-templates/deploy@trunk
with:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/example-build-deploy-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ jobs:
contents: read
id-token: write
environment: dev
# Only on push to $default-branch
if: github.ref_name == "trunk"
# Only on push to trunk
if: github.ref == 'refs/heads/trunk'
steps:
- uses: 3lvia/core-github-actions-templates/deploy@trunk
with:
Expand All @@ -75,8 +75,8 @@ jobs:
contents: read
id-token: write
environment: test
# Only on push to $default-branch
if: github.ref_name == "trunk"
# Only on push to trunk
if: github.ref == 'refs/heads/trunk'
steps:
- uses: 3lvia/core-github-actions-templates/deploy@trunk
with:
Expand All @@ -96,8 +96,8 @@ jobs:
contents: read
id-token: write
environment: prod
# Only on push to $default-branch
if: github.ref_name == "trunk"
# Only on push to trunk
if: github.ref == 'refs/heads/trunk'
steps:
- uses: 3lvia/core-github-actions-templates/deploy@trunk
with:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/update-starter-workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,8 @@ jobs:
sed -i "s/ SYSTEM_NAME: 'core'/ SYSTEM_NAME: '<your system name here>'/g" "$new_workflow_path"
sed -i "s/ HELM_VALUES_PATH: '.*'/ HELM_VALUES_PATH: '.github\/deploy\/values.yml'/g" "$new_workflow_path"
sed -i "s/ PROJECT_FILE: '.*'/ PROJECT_FILE: '<your project file path here>'/g" "$new_workflow_path"
sed -i 's/github.ref_name == "trunk"/github.ref_name == $default-branch/g' "$new_workflow_path"
sed -i "s/# pull_request:/ pull_request:/g" "$new_workflow_path"
sed -i "s/# branches: \[trunk\]/ branches: \[trunk\]/g" "$new_workflow_path"
sed -i 's/branches: \[trunk\]/branches: \[$default-branch\]/g' "$new_workflow_path"
sed -i 's/# branches: \[trunk\]/ branches: \[$default-branch\]/g' "$new_workflow_path"
new_workflow_properties_file="dotgithub/workflow-templates/${file_name_no_prefix%.yml}.properties.json"
if [ ! -f "$new_workflow_properties_file" ]; then
Expand Down

0 comments on commit 382085f

Please sign in to comment.