Skip to content

Commit

Permalink
release: move secrets to workflow environment (#584)
Browse files Browse the repository at this point in the history
Migrate applicable secrets to a new 'release' workflow environment. This
is a security measure to help ensure secrets cannot be accessed by those
without proper permissions.

An example of a passing `build-git-installers` workflow with these
changes can be found
[here](https://github.com/ldennington/git/actions/runs/5182147378) (I
set up my fork with the same migrated secret values as this repo).

Note that the old actions secrets will be left in this repo until the
next successful release, at which point they can be safely removed.
  • Loading branch information
ldennington authored and dscho committed Aug 8, 2023
2 parents cbbefe1 + 6ab087b commit 94dcf1e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build-git-installers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
# Check prerequisites for the workflow
prereqs:
runs-on: ubuntu-latest
environment: release
env:
AZ_SUB: ${{ secrets.AZURE_SUBSCRIPTION }}
AZ_CREDS: ${{ secrets.AZURE_CREDENTIALS }}
Expand Down Expand Up @@ -56,6 +57,7 @@ jobs:
# Build Windows installers (x86_64 installer & portable)
windows_pkg:
runs-on: windows-2019
environment: release
needs: prereqs
env:
GPG_OPTIONS: "--batch --yes --no-tty --list-options no-show-photos --verify-options no-show-photos --pinentry-mode loopback"
Expand Down Expand Up @@ -151,6 +153,7 @@ jobs:
path: artifacts
windows_artifacts:
runs-on: windows-2019
environment: release
needs: [prereqs, windows_pkg]
env:
HOME: "${{github.workspace}}\\home"
Expand Down Expand Up @@ -377,6 +380,7 @@ jobs:
osx_sign_payload:
# ESRP service requires signing to run on Windows
runs-on: windows-latest
environment: release
needs: osx_build
steps:
- name: Check out repository
Expand Down Expand Up @@ -484,6 +488,7 @@ jobs:
osx_sign_and_notarize_pkg:
# ESRP service requires signing to run on Windows
runs-on: windows-latest
environment: release
needs: osx_pack
steps:
- name: Check out repository
Expand Down Expand Up @@ -660,6 +665,7 @@ jobs:
path: artifacts/
ubuntu_sign-artifacts:
runs-on: windows-latest # Must be run on Windows due to ESRP executable OS compatibility
environment: release
needs: [ubuntu_build, prereqs]
if: needs.prereqs.outputs.deb_signable == 'true'
env:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release-apt-get.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
jobs:
release:
runs-on: ubuntu-latest
environment: release
steps:
- uses: actions/checkout@v3

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release-homebrew.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
jobs:
release:
runs-on: ubuntu-latest
environment: release
steps:
- id: version
name: Compute version number
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release-winget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
jobs:
release:
runs-on: windows-latest
environment: release
steps:
- name: Publish manifest with winget-create
run: |
Expand Down

0 comments on commit 94dcf1e

Please sign in to comment.