Skip to content

Commit d462b47

Browse files
Cleanup of workflow files (#187)
1 parent 1f33614 commit d462b47

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

.github/workflows/main.yml

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,22 @@ jobs:
5050
- name: Determine stable version
5151
id: stable-version
5252
if: ${{ github.event_name == 'release' }}
53+
env:
54+
TAG_NAME: ${{ github.event.release.tag_name }}
5355
run: |
54-
if ! [[ "${{ github.event.release.tag_name }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z].*)?$ ]]; then
55-
echo "Invalid version: ${{ github.event.release.tag_name }}"
56+
if ! [[ "${TAG_NAME}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z].*)?$ ]]; then
57+
echo "Invalid version: ${TAG_NAME}"
5658
exit 1
5759
fi
58-
59-
echo "version=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
60+
61+
echo "version=${TAG_NAME}" >> "$GITHUB_OUTPUT"
6062
6163
- name: Determine prerelease version
6264
id: pre-version
6365
if: ${{ github.event_name != 'release' }}
6466
run: |
6567
hash="${{ github.event.pull_request.head.sha || github.sha }}"
66-
echo "version=0.0.0-ci-${hash:0:7}" >> $GITHUB_OUTPUT
68+
echo "version=0.0.0-ci-${hash:0:7}" >> "$GITHUB_OUTPUT"
6769
6870
outputs:
6971
version: ${{ steps.stable-version.outputs.version || steps.pre-version.outputs.version }}
@@ -78,6 +80,8 @@ jobs:
7880
steps:
7981
- name: Checkout
8082
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
83+
with:
84+
persist-credentials: false # we don't need to push anything
8185

8286
- name: Install .NET
8387
uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 # v4.2.0
@@ -106,6 +110,8 @@ jobs:
106110
steps:
107111
- name: Checkout
108112
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
113+
with:
114+
persist-credentials: false
109115

110116
- name: Install .NET
111117
uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 # v4.2.0
@@ -149,6 +155,8 @@ jobs:
149155
steps:
150156
- name: Checkout
151157
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
158+
with:
159+
persist-credentials: false
152160

153161
- name: Install .NET
154162
uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 # v4.2.0
@@ -166,9 +174,11 @@ jobs:
166174
-p:ContinuousIntegrationBuild=true
167175
168176
- name: Run pack
177+
env:
178+
VERSION: ${{ needs.version.outputs.version }}
169179
run: >
170180
dotnet pack
171-
-p:Version=${{ needs.version.outputs.version }}
181+
-p:Version="${VERSION}"
172182
-p:ContinuousIntegrationBuild=true
173183
--no-restore
174184
--no-build
@@ -226,11 +236,12 @@ jobs:
226236
- name: Dispatch deployment
227237
env:
228238
GITHUB_TOKEN: ${{ steps.retrieve-secret-pat.outputs.github-pat-bitwarden-devops-bot-repo-scope }}
239+
VERSION: ${{ needs.version.outputs.version }}
229240
run: >
230241
gh workflow run deploy-passwordless-dotnet
231242
--repo bitwarden/passwordless-devops
232-
--field repository=${{ github.repository }}
233-
--field run-id=${{ github.run_id }}
234-
--field artifact=packages
235-
--field environment=${{ matrix.environment }}
236-
--field version=${{ needs.version.outputs.version }}
243+
--field repository="${GITHUB_REPOSITORY}"
244+
--field run-id="${GITHUB_RUN_ID}"
245+
--field artifact="packages"
246+
--field environment="${{ matrix.environment }}"
247+
--field version="${VERSION}"

0 commit comments

Comments
 (0)