Skip to content

Commit 5098611

Browse files
committed
Merge branch 'main' into fix/line-discounts-discoverabilty
2 parents 70b15c3 + b4e828a commit 5098611

1 file changed

Lines changed: 58 additions & 7 deletions

File tree

.github/workflows/deploy-master-staging.yaml

Lines changed: 58 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ on:
33
push:
44
branches:
55
- main
6-
- ci/staging/**
76
workflow_dispatch:
7+
8+
permissions: {}
9+
810
jobs:
911
build:
10-
runs-on: ubuntu-22.04
12+
runs-on: ubuntu-24.04
1113
permissions:
12-
id-token: write # needed by aws-actions/configure-aws-credentials
1314
contents: read
1415
outputs:
1516
CUSTOM_VERSION: ${{ env.CUSTOM_VERSION }}
@@ -32,19 +33,44 @@ jobs:
3233
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3334
with:
3435
persist-credentials: false
36+
3537
- name: Set custom version
3638
run: |
3739
HASH=$(git rev-parse --short HEAD)
3840
CURRENT_VERSION=$(jq -r .version package.json)
3941
RELEASE="${CURRENT_VERSION}-${HASH}"
4042
echo "CUSTOM_VERSION=${RELEASE}" >> $GITHUB_ENV
4143
echo "SENTRY_RELEASE=${RELEASE}" >> $GITHUB_ENV
44+
4245
- uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
46+
with:
47+
# Explicitly disables cache to ensure cache is always disabled
48+
cache: false
49+
4350
- name: Setup Node
44-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
51+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
4552
with:
4653
node-version-file: "package.json"
47-
cache: "pnpm"
54+
# Cache is intentionally disabled for security.
55+
#
56+
# GitHub Actions cache doesn't provide any trust boundary:
57+
# - Any workflow that can run in this repository (e.g., pull_request
58+
# or push events) can populate cache entries (using any cache keys)
59+
# - A trusted workflow (like this build job) can then later restore
60+
# that cache and execute or deploy malicious content
61+
#
62+
# This enables cache poisoning, meaning someone could inject
63+
# malicious NPM dependencies or malicious binaries (by replacing
64+
# the node or npm executable with a malicious one) then leading to
65+
# code execution during build or compromised deployments (e.g.,
66+
# implanting backdoors inside the JS or HTML files generated
67+
# during `pnpm run build`)
68+
#
69+
# Since this workflow deploys to AWS, it must not consume artifacts
70+
# from shared cache.
71+
package-manager-cache: false
72+
cache: ""
73+
4874
- name: Package
4975
timeout-minutes: 15
5076
run: |
@@ -54,6 +80,31 @@ jobs:
5480
run: |
5581
pnpm run build
5682
83+
- name: Upload Build
84+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
85+
with:
86+
name: "build"
87+
path: "build/"
88+
if-no-files-found: error
89+
retention-days: 7
90+
91+
deploy:
92+
runs-on: ubuntu-24.04
93+
needs: [build]
94+
95+
environment:
96+
deployment: false
97+
name: deploy-staging
98+
99+
permissions:
100+
id-token: write
101+
102+
steps:
103+
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
104+
with:
105+
name: build
106+
path: build/
107+
57108
- name: Configure AWS Credentials
58109
uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4.3.1
59110
with:
@@ -85,14 +136,14 @@ jobs:
85136
CDN_DISTRIBUTIONS: ${{ secrets.AWS_CLOUD_STAGING_CDN_DISTRIBUTIONS }}
86137

87138
notify-slack:
88-
needs: build
139+
needs: [build, deploy]
89140
if: always()
90141
permissions: {}
91142
uses: saleor/saleor-internal-actions/.github/workflows/notify-slack.yaml@eb0c692da7bf13f5e1a82c17488b24c514dd10a1 # v1.10.0
92143
with:
93144
type: deployment
94145
ref: ${{ needs.build.outputs.CUSTOM_VERSION || github.ref_name }}
95-
status: ${{ needs.build.result }}
146+
status: ${{ needs.deploy.result }}
96147
product: dashboard
97148
environment: saleor-master-staging
98149
mention_on: failure

0 commit comments

Comments
 (0)