Skip to content

Commit

Permalink
refactor: make if statements more consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
blacha committed Feb 19, 2025
1 parent 5d19a56 commit c4e728b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
# v7.1
version_major_minor: ${{ steps.version.outputs.version_major_minor }}

# Tagging information as a JSON array
# eg ["ghcr.io/linz/basemaps/cli:latest", "ghcr.io/linz/basemaps/cli:v7"]
# Tagging information as a JSON object
# eg { cli: ["ghcr.io/linz/basemaps/cli:latest", "ghcr.io/linz/basemaps/cli:v7"], needs_containers: true }
tags: ${{ steps.tags.outputs.result }}

steps:
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
permissions:
id-token: write
contents: write

steps:
- uses: linz/action-typescript@v3

Expand All @@ -50,7 +51,7 @@ jobs:
run: node scripts/detect.unlinked.dep.mjs

- name: (Prod) Create tag
if: github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, 'release:')
if: github.repository == 'linz/basemaps' && github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, 'release:')
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
Expand All @@ -59,13 +60,13 @@ jobs:
git push --tags
- name: (Prod) Create github release
if: github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, 'release:')
if: github.repository == 'linz/basemaps' && github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, 'release:')
run: npx conventional-github-releaser -p angular
env:
CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: (Prod) Publish NPM
if: github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, 'release:')
if: github.repository == 'linz/basemaps' && github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, 'release:')
run: npx lerna publish from-git --yes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -78,7 +79,7 @@ jobs:
runs-on: ubuntu-latest
concurrency: deploy-dev-${{ github.ref }}
needs: [build-deploy]
if: github.ref == 'refs/heads/master' && github.repository == 'linz/basemaps'
if: github.repository == 'linz/basemaps' && github.ref == 'refs/heads/master'

environment:
name: nonprod
Expand Down Expand Up @@ -134,7 +135,7 @@ jobs:
runs-on: ubuntu-latest
concurrency: deploy-prod-${{ github.ref }}
needs: [deploy-dev]
if: github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, 'release:')
if: github.repository == 'linz/basemaps' && github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, 'release:')

environment:
name: prod
Expand Down

0 comments on commit c4e728b

Please sign in to comment.