Skip to content

Commit 4c86acd

Browse files
authored
fix: update modules, workflows, tests, examples, etc (#156)
Signed-off-by: matttrach <matt.trachier@suse.com>
1 parent b918e04 commit 4c86acd

80 files changed

Lines changed: 1598 additions & 789 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.envrc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ cleanup() {
2525
}
2626

2727
if ! which "$0" | grep -q nix; then
28-
print 'Entering Environment...'
28+
echo 'Entering Environment...'
2929
basename="$(get_repo_basename)"
3030
profile="$(get_profile)"
3131
export NIX_PROFILE="$profile"
3232

33-
print 'Updating Nix Cache...'
33+
echo 'Updating Nix Cache...'
3434
if ! nf flake update; then
35-
print 'Failed to update Nix flake, continuing with existing cache...'
35+
echo 'Failed to update Nix flake, continuing with existing cache...'
3636
git checkout flake.lock
3737
fi
3838

@@ -45,7 +45,7 @@ if ! which "$0" | grep -q nix; then
4545

4646
nf profile list --profile "$profile"
4747

48-
print 'Starting...'
48+
echo 'Starting...'
4949
# --impure allows Nix to reuse previously built paths
5050
# --ignore-environment ignores the environment variables and paths to tools not installed by nix
5151
nf develop \
@@ -68,7 +68,7 @@ if ! which "$0" | grep -q nix; then
6868
--profile "$profile" \
6969
--command bash -c "bash --rcfile .envrc"
7070

71-
print 'Exiting Dev Environment...'
71+
echo 'Exiting Dev Environment...'
7272
cleanup
7373
else
7474
# this is run inside the dev environment so we can make assumptions about what is available

.github/workflows/fossa.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ jobs:
1515
timeout-minutes: 30
1616
steps:
1717
- name: Checkout
18+
# https://github.com/actions/checkout/releases
1819
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1920

2021
# The FOSSA token is shared between all repos in Rancher's GH org. It can be
2122
# used directly and there is no need to request specific access to EIO.
2223
- name: Read FOSSA token
2324
# https://github.com/rancher-eio/read-vault-secrets/commits/main/
24-
uses: rancher-eio/read-vault-secrets@7282bf97898cd1c16c89f837e0bb442e6d384c89 # latest
25+
uses: rancher-eio/read-vault-secrets@7282bf97898cd1c16c89f837e0bb442e6d384c89 # latest
2526
with:
2627
secrets: |
2728
secret/data/github/org/rancher/fossa/push token | FOSSA_API_KEY_PUSH_ONLY

.github/workflows/release.yaml

Lines changed: 24 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ env:
1212
ACME_SERVER_URL: https://acme-v02.api.letsencrypt.org/directory
1313
AWS_MAX_ATTEMPTS: 100
1414
AWS_RETRY_MODE: adaptive
15+
NIX_INSTALL_SHA: e9d447ce3d2ff62d7ff9cb6ef401de6fa8acb148839dd00f7271945d7b638b14
16+
NIX_INSTALL_VERSION: 2.34.7
1517

1618
permissions: write-all
1719

@@ -21,48 +23,13 @@ jobs:
2123
outputs:
2224
release_pr: ${{ steps.release-please.outputs.pr }}
2325
steps:
24-
- uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4
26+
# https://github.com/googleapis/release-please-action/releases
27+
- uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
2528
id: release-please
2629
with:
2730
release-type: terraform-module
28-
- name: Install Let's Encrypt Roots and Intermediate Certificates
29-
if: steps.release-please.outputs.pr
30-
run: |
31-
# https://letsencrypt.org/certificates/
32-
sudo apt-get update -y
33-
sudo apt-get install -y ca-certificates wget openssl libssl-dev
34-
wget https://letsencrypt.org/certs/isrgrootx1.pem # rsa
35-
sudo cp isrgrootx1.pem /usr/local/share/ca-certificates/
36-
wget https://letsencrypt.org/certs/isrg-root-x2.pem # ecdsa
37-
sudo cp isrg-root-x2.pem /usr/local/share/ca-certificates/
38-
wget https://letsencrypt.org/certs/2024/r11.pem
39-
sudo cp r11.pem /usr/local/share/ca-certificates/
40-
wget https://letsencrypt.org/certs/2024/r10.pem
41-
sudo cp r10.pem /usr/local/share/ca-certificates/
42-
wget https://letsencrypt.org/certs/2024/e5.pem
43-
sudo cp e5.pem /usr/local/share/ca-certificates/
44-
wget https://letsencrypt.org/certs/2024/e6.pem
45-
sudo cp e6.pem /usr/local/share/ca-certificates/
46-
sudo update-ca-certificates
47-
- name: Verify Lets Encrypt CA Functionality
48-
if: steps.release-please.outputs.pr
49-
run: |
50-
# Function to check if Let's Encrypt CA is effectively used by openssl
51-
check_letsencrypt_ca() {
52-
# Try to verify a known Let's Encrypt certificate (you can use any valid one)
53-
if openssl s_client -showcerts -connect letsencrypt.org:443 < /dev/null | openssl x509 -noout -issuer | grep -q "Let's Encrypt"; then
54-
return 0 # Success
55-
else
56-
return 1 # Failure
57-
fi
58-
}
59-
if check_letsencrypt_ca; then
60-
echo "Let's Encrypt CA is functioning correctly."
61-
else
62-
echo "Error: Let's Encrypt CA is not being used for verification."
63-
exit 1
64-
fi
65-
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
31+
# https://github.com/actions/github-script/releases
32+
- uses: actions/github-script@d746ffe35508b1917358783b479e04febd2b8f71 # v9.0.0
6633
if: steps.release-please.outputs.pr
6734
with:
6835
github-token: ${{secrets.GITHUB_TOKEN}}
@@ -80,12 +47,14 @@ jobs:
8047
if: needs.release.outputs.release_pr
8148
runs-on: ubuntu-latest
8249
steps:
50+
# https://github.com/actions/checkout/releases
8351
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
8452
with:
8553
token: ${{secrets.GITHUB_TOKEN}}
8654
fetch-depth: 0
8755
- id: aws-creds
88-
uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 # v6
56+
# https://github.com/aws-actions/configure-aws-credentials/releases
57+
uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 # v6.1.0
8958
with:
9059
role-to-assume: ${{env.AWS_ROLE}}
9160
role-session-name: ${{github.run_id}}
@@ -94,10 +63,14 @@ jobs:
9463
output-credentials: true
9564
- name: install-nix
9665
run: |
97-
curl -L https://nixos.org/nix/install | sh
66+
curl -L -o install-nix.sh "https://releases.nixos.org/nix/nix-${NIX_INSTALL_VERSION}/install"
67+
echo "${NIX_INSTALL_SHA} install-nix.sh" | sha256sum -c -
68+
chmod +x install-nix.sh
69+
./install-nix.sh
9870
source /home/runner/.nix-profile/etc/profile.d/nix.sh
9971
nix --version
10072
which nix
73+
rm -f install-nix.sh
10174
- name: run_tests
10275
shell: '/home/runner/.nix-profile/bin/nix develop --ignore-environment --extra-experimental-features nix-command --extra-experimental-features flakes --keep HOME --keep SSH_AUTH_SOCK --keep IDENTIFIER --keep GITHUB_TOKEN --keep GITHUB_OWNER --keep ZONE --keep AWS_ROLE --keep AWS_REGION --keep AWS_DEFAULT_REGION --keep AWS_ACCESS_KEY_ID --keep AWS_SECRET_ACCESS_KEY --keep AWS_SESSION_TOKEN --keep UPDATECLI_GPGTOKEN --keep UPDATECLI_GITHUB_TOKEN --keep UPDATECLI_GITHUB_ACTOR --keep GPG_SIGNING_KEY --keep NIX_SSL_CERT_FILE --keep NIX_ENV_LOADED --keep TERM --command bash -e {0}'
10376
env:
@@ -123,12 +96,14 @@ jobs:
12396
if: always() && needs.release.outputs.release_pr
12497
runs-on: ubuntu-latest
12598
steps:
99+
# https://github.com/actions/checkout/releases
126100
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
127101
with:
128102
token: ${{secrets.GITHUB_TOKEN}}
129103
fetch-depth: 0
130104
- id: aws-creds
131-
uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 # v6
105+
# https://github.com/aws-actions/configure-aws-credentials/releases
106+
uses: aws-actions/configure-aws-credentials@ec61189d14ec14c8efccab744f656cffd0e33f37 # v6.1.0
132107
with:
133108
role-to-assume: ${{env.AWS_ROLE}}
134109
role-session-name: ${{github.run_id}}-cleanup
@@ -137,10 +112,14 @@ jobs:
137112
output-credentials: true
138113
- name: install-nix
139114
run: |
140-
curl -L https://nixos.org/nix/install | sh
115+
curl -L -o install-nix.sh "https://releases.nixos.org/nix/nix-${NIX_INSTALL_VERSION}/install"
116+
echo "${NIX_INSTALL_SHA} install-nix.sh" | sha256sum -c -
117+
chmod +x install-nix.sh
118+
./install-nix.sh
141119
source /home/runner/.nix-profile/etc/profile.d/nix.sh
142120
nix --version
143121
which nix
122+
rm -f install-nix.sh
144123
- name: cleanup
145124
shell: '/home/runner/.nix-profile/bin/nix develop --ignore-environment --extra-experimental-features nix-command --extra-experimental-features flakes --keep HOME --keep SSH_AUTH_SOCK --keep IDENTIFIER --keep GITHUB_TOKEN --keep GITHUB_OWNER --keep ZONE --keep AWS_ROLE --keep AWS_REGION --keep AWS_DEFAULT_REGION --keep AWS_ACCESS_KEY_ID --keep AWS_SECRET_ACCESS_KEY --keep AWS_SESSION_TOKEN --keep UPDATECLI_GPGTOKEN --keep UPDATECLI_GITHUB_TOKEN --keep UPDATECLI_GITHUB_ACTOR --keep GPG_SIGNING_KEY --keep NIX_SSL_CERT_FILE --keep NIX_ENV_LOADED --keep TERM --command bash -e {0}'
146125
env:
@@ -160,7 +139,8 @@ jobs:
160139
if: success() && needs.release.outputs.release_pr #Ensure the test jobs succeeded, and that a release PR was created.
161140
runs-on: ubuntu-latest
162141
steps:
163-
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
142+
# https://github.com/actions/github-script/releases
143+
- uses: actions/github-script@d746ffe35508b1917358783b479e04febd2b8f71 # v9.0.0
164144
with:
165145
github-token: ${{secrets.GITHUB_TOKEN}}
166146
script: |

0 commit comments

Comments
 (0)