Skip to content

Commit 456e260

Browse files
authored
chore: Reorder step configurations (#6521)
1 parent 6d17ea5 commit 456e260

15 files changed

Lines changed: 262 additions & 95 deletions

.github/actions/commit-and-tag/action.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,15 @@ inputs:
1313
runs:
1414
using: 'composite'
1515
steps:
16-
- run: |
16+
- env:
17+
VERSION: ${{ inputs.version }}
18+
USER_EMAIL: ${{ inputs.user-email }}
19+
USER_NAME: ${{ inputs.user-name }}
20+
shell: bash
21+
run: |
1722
git config --global user.email "$USER_EMAIL"
1823
git config --global user.name "$USER_NAME"
1924
git add -A
2025
git commit -m "v$VERSION"
2126
git tag "v$VERSION" -m "v$VERSION"
2227
git push --follow-tags
23-
shell: bash
24-
# map inputs to environment variables to avoid shell injection
25-
env:
26-
VERSION: ${{ inputs.version }}
27-
USER_EMAIL: ${{ inputs.user-email }}
28-
USER_NAME: ${{ inputs.user-name }}

.github/actions/setup/action.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ runs:
3939
with:
4040
version: ${{ inputs.pnpm-version }}
4141
- id: resolve-registry-url
42+
env:
43+
REGISTRY_URL: ${{ inputs.registry-url }}
44+
REGISTRY_TOKEN: ${{ inputs.registry-token }}
45+
REPO: ${{ github.repository }}
4246
shell: bash
4347
run: |
4448
if [[ -n "$REGISTRY_URL" ]]; then
@@ -53,21 +57,17 @@ runs:
5357
else
5458
echo "url=https://registry.npmjs.org" >> $GITHUB_OUTPUT
5559
fi
56-
env:
57-
REGISTRY_URL: ${{ inputs.registry-url }}
58-
REGISTRY_TOKEN: ${{ inputs.registry-token }}
59-
REPO: ${{ github.repository }}
6060
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
6161
with:
6262
node-version: ${{ inputs.node-version }}
6363
registry-url: ${{ steps.resolve-registry-url.outputs.url }}
6464
cache: 'pnpm'
6565
package-manager-cache: ${{ inputs.package-manager-cache }}
6666
# Install dependencies without lifecycle scripts.
67-
- run: pnpm install --ignore-scripts ${{ inputs.pnpm-install-args }}
68-
shell: bash
69-
env:
67+
- env:
7068
NODE_AUTH_TOKEN: ${{ inputs.registry-token }}
71-
# Run lifecycle scripts after removing the registry token from the environment.
72-
- run: pnpm rebuild
7369
shell: bash
70+
run: pnpm install --ignore-scripts ${{ inputs.pnpm-install-args }}
71+
# Run lifecycle scripts after removing the registry token from the environment.
72+
- shell: bash
73+
run: pnpm rebuild

.github/workflows/api-docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ jobs:
3434
yarn generate
3535
yarn doc
3636
37-
- uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
38-
id: app-token
37+
- id: app-token
38+
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
3939
with:
4040
client-id: ${{ secrets.SAP_CLOUD_SDK_BOT_CLIENT_ID }}
4141
private-key: ${{ secrets.SAP_CLOUD_SDK_BOT_PRIVATE_KEY }}

.github/workflows/auto-dependabot-fix.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ jobs:
88
if: github.actor == 'dependabot[bot]' && !github.event.pull_request.head.repo.fork
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
12-
id: app-token
11+
- id: app-token
12+
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
1313
with:
1414
client-id: ${{ secrets.SAP_CLOUD_SDK_BOT_CLIENT_ID }}
1515
private-key: ${{ secrets.SAP_CLOUD_SDK_BOT_PRIVATE_KEY }}

.github/workflows/auto-lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ jobs:
88
if: github.actor != 'dependabot[bot]' && !github.event.pull_request.head.repo.fork
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
12-
id: app-token
11+
- id: app-token
12+
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
1313
with:
1414
client-id: ${{ secrets.SAP_CLOUD_SDK_BOT_CLIENT_ID }}
1515
private-key: ${{ secrets.SAP_CLOUD_SDK_BOT_PRIVATE_KEY }}

.github/workflows/blackduck.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,20 @@ jobs:
2020
- run: sudo apt-get install jq
2121
- run: echo "project_version=$(cat package.json | jq '.version' | tr -d '"')" >> $GITHUB_ENV
2222
- name: Blackduck Scan
23-
uses: SAP/project-piper-action@43db6643d830b42717eda052300d87c22b0da73b
24-
with:
25-
command: detectExecuteScan
26-
flags: \
27-
--version=$PROJECT_VERSION \
28-
--excludedDirectories=test-packages
2923
env:
3024
PIPER_token: ${{ secrets.BLACKDUCK_TOKEN }}
3125
PROJECT_VERSION: ${{ env.project_version }}
3226
DETECT_TIMEOUT: 6000
3327
DETECT_YARN_EXCLUDED_WORKSPACES: test-packages/**
3428
DETECT_YARN_DEPENDENCY_TYPES_EXCLUDED: NON_PRODUCTION
35-
- if: failure() || cancelled()
36-
name: Slack Notify
37-
uses: rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661 # v2.3.3
29+
uses: SAP/project-piper-action@43db6643d830b42717eda052300d87c22b0da73b
30+
with:
31+
command: detectExecuteScan
32+
flags: \
33+
--version=$PROJECT_VERSION \
34+
--excludedDirectories=test-packages
35+
- name: Slack Notify
36+
if: failure() || cancelled()
3837
env:
3938
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
4039
SLACK_USERNAME: SDK Pipeline Bot
@@ -44,3 +43,4 @@ jobs:
4443
SLACK_COLOR: ${{ job.status }}
4544
SLACK_MSG_AUTHOR: ' '
4645
SLACK_ICON: https://sap.github.io/cloud-sdk/img/logo.png
46+
uses: rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661 # v2.3.3

.github/workflows/build.yml

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ jobs:
4343
- run: yarn test:self
4444
- run: yarn test:build-packages
4545
- run: yarn test:type
46-
- if: ${{ github.event_name != 'pull_request' && (failure() || cancelled()) }}
47-
name: Slack Notify
48-
uses: rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661 # v2.3.3
46+
- name: Slack Notify
47+
if: ${{ github.event_name != 'pull_request' && (failure() || cancelled()) }}
4948
env:
5049
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
5150
SLACK_USERNAME: SDK Pipeline Bot
@@ -55,6 +54,7 @@ jobs:
5554
SLACK_COLOR: ${{ job.status }}
5655
SLACK_MSG_AUTHOR: ' '
5756
SLACK_ICON: https://sap.github.io/cloud-sdk/img/logo.png
57+
uses: rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661 # v2.3.3
5858

5959
checks:
6060
if: inputs.canary-release-skip-checks == false
@@ -69,28 +69,27 @@ jobs:
6969
- name: REUSE Compliance Check
7070
uses: fsfe/reuse-action@676e2d560c9a403aa252096d99fcab3e1132b0f5 # v6.0.0
7171
- run: yarn install --frozen-lockfile --ignore-engines
72-
- run: yarn lint
73-
name: Static Code Check
74-
- run: yarn check:test-service
75-
name: Test Service Version Check
76-
- run: yarn check:dependencies
77-
name: Undeclared dependency Check
78-
- uses: ./.github/actions/check-public-api
72+
- name: Static Code Check
73+
run: yarn lint
74+
- name: Test Service Version Check
75+
run: yarn check:test-service
76+
- name: Undeclared dependency Check
77+
run: yarn check:dependencies
78+
- name: Check public api
79+
uses: ./.github/actions/check-public-api
7980
with:
8081
force_internal_exports: 'true'
8182
excluded_packages: 'eslint-config, util, test-util'
82-
name: Check public api
83-
- run: yarn test:self
84-
name: Self tests for tools
85-
- run: yarn check:circular
86-
name: Circular dependency Check
87-
- run: yarn doc
88-
name: API Doc Check
89-
- run: yarn check:license
90-
name: License Check
91-
- if: ${{ github.event_name != 'pull_request' && (failure() || cancelled()) }}
92-
name: Slack Notify
93-
uses: rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661 # v2.3.3
83+
- name: Self tests for tools
84+
run: yarn test:self
85+
- name: Circular dependency Check
86+
run: yarn check:circular
87+
- name: API Doc Check
88+
run: yarn doc
89+
- name: License Check
90+
run: yarn check:license
91+
- name: Slack Notify
92+
if: ${{ github.event_name != 'pull_request' && (failure() || cancelled()) }}
9493
env:
9594
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
9695
SLACK_USERNAME: SDK Pipeline Bot
@@ -100,6 +99,7 @@ jobs:
10099
SLACK_COLOR: ${{ job.status }}
101100
SLACK_MSG_AUTHOR: ' '
102101
SLACK_ICON: https://sap.github.io/cloud-sdk/img/logo.png
102+
uses: rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661 # v2.3.3
103103

104104
e2e-tests:
105105
if: inputs.canary-release-skip-checks == false
@@ -129,16 +129,16 @@ jobs:
129129
github-token: '${{ secrets.GITHUB_TOKEN }}'
130130
- name: Approve a PR
131131
if: ${{ steps.metadata.outputs.update-type != 'version-update:semver-major' }}
132-
run: gh pr review --approve "$PR_URL"
133132
env:
134133
PR_URL: ${{github.event.pull_request.html_url}}
135134
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
135+
run: gh pr review --approve "$PR_URL"
136136
- name: Enable auto-merge for Dependabot PRs
137137
if: ${{ steps.metadata.outputs.update-type != 'version-update:semver-major' }}
138-
run: gh pr merge --auto --squash "$PR_URL"
139138
env:
140139
PR_URL: ${{github.event.pull_request.html_url}}
141140
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
141+
run: gh pr merge --auto --squash "$PR_URL"
142142
canary-release-pre-check:
143143
if: inputs.is-workflow-call && inputs.canary-release-skip-checks == false
144144
runs-on: ubuntu-latest
@@ -151,8 +151,8 @@ jobs:
151151
steps:
152152
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
153153
- run: git fetch --depth=1
154-
- id: date-check
155-
name: Check if latest commit is within 24 hrs
154+
- name: Check if latest commit is within 24 hrs
155+
id: date-check
156156
run: |
157157
lastCommitDate=$(git --no-pager log -n 1 "$REF_NAME" --pretty=format:"%at")
158158
curDate=$(date +%s)
@@ -205,9 +205,9 @@ jobs:
205205
node-version: 22
206206
cache: 'yarn'
207207
- run: yarn install --frozen-lockfile --ignore-engines
208-
- uses: ./.github/actions/get-changelog
209-
name: Get Changelog
208+
- name: Get Changelog
210209
id: get-changelog
210+
uses: ./.github/actions/get-changelog
211211
- name: Create Release
212212
env:
213213
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/bump.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ jobs:
1313
outputs:
1414
version: ${{ steps.bump.outputs.version }}
1515
steps:
16-
- uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
17-
id: app-token
16+
- id: app-token
17+
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
1818
with:
1919
client-id: ${{ secrets.SAP_CLOUD_SDK_BOT_CLIENT_ID }}
2020
private-key: ${{ secrets.SAP_CLOUD_SDK_BOT_PRIVATE_KEY }}
@@ -39,15 +39,15 @@ jobs:
3939
with:
4040
majorVersion: ${{ inputs.majorVersion }}
4141

42-
- run: yarn ts-node ${{ github.workspace }}/scripts/update-documentation-md.ts
43-
env:
42+
- env:
4443
NEXT_PACKAGE_VERSION: ${{ steps.bump.outputs.version }}
44+
run: yarn ts-node ${{ github.workspace }}/scripts/update-documentation-md.ts
4545

4646
- name: merge Changelogs
4747
id: merge-changelogs
48-
uses: ./.github/actions/merge-and-write-changelogs
4948
env:
5049
VERSION: ${{ steps.bump.outputs.version }}
50+
uses: ./.github/actions/merge-and-write-changelogs
5151

5252
- name: commit and tag
5353
uses: ./.github/actions/commit-and-tag

.github/workflows/check-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1515
- name: Collect changed files
16-
uses: step-security/changed-files@2e07db73e5ccdb319b9a6c7766bd46d39d304bad # v47.0.5
1716
id: changed-files
17+
uses: step-security/changed-files@2e07db73e5ccdb319b9a6c7766bd46d39d304bad # v47.0.5
1818
with:
1919
files: |
2020
.changeset/**

.github/workflows/downloads.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ jobs:
1616
node-version: 22
1717
cache: 'yarn'
1818
- run: yarn install --frozen-lockfile --ignore-engines
19-
- run: yarn ts-node scripts/npm-stats.ts
20-
name: Download Stats
19+
- name: Download Stats
20+
run: yarn ts-node scripts/npm-stats.ts

0 commit comments

Comments
 (0)