Skip to content

Commit 7b366a2

Browse files
dependabot[bot]neilime
authored andcommitted
chore(deps): bump the github-actions-dependencies group across 3 directories with 8 updates
Bumps the github-actions-dependencies group with 8 updates in the / directory: | Package | From | To | | --- | --- | --- | | [hoverkraft-tech/ci-github-common/.github/workflows/greetings.yml](https://github.com/hoverkraft-tech/ci-github-common) | `0.30.2` | `0.31.0` | | [hoverkraft-tech/ci-github-publish/.github/workflows/release-actions.yml](https://github.com/hoverkraft-tech/ci-github-publish) | `0.15.2` | `0.16.0` | | [hoverkraft-tech/ci-github-common/.github/workflows/need-fix-to-issue.yml](https://github.com/hoverkraft-tech/ci-github-common) | `0.30.2` | `0.31.0` | | [hoverkraft-tech/ci-github-common/.github/workflows/semantic-pull-request.yml](https://github.com/hoverkraft-tech/ci-github-common) | `0.30.2` | `0.31.0` | | [hoverkraft-tech/ci-github-common/.github/workflows/linter.yml](https://github.com/hoverkraft-tech/ci-github-common) | `0.30.2` | `0.31.0` | | [hoverkraft-tech/ci-github-common/.github/workflows/stale.yml](https://github.com/hoverkraft-tech/ci-github-common) | `0.30.2` | `0.31.0` | | [hoverkraft-tech/ci-github-container/.github/workflows/docker-build-images.yml](https://github.com/hoverkraft-tech/ci-github-container) | `0.29.1` | `0.30.0` | | [hoverkraft-tech/ci-github-common](https://github.com/hoverkraft-tech/ci-github-common) | `0.30.2` | `0.31.0` | Bumps the github-actions-dependencies group with 1 update in the /actions/lint directory: [hoverkraft-tech/ci-github-common](https://github.com/hoverkraft-tech/ci-github-common). Bumps the github-actions-dependencies group with 1 update in the /actions/test directory: [hoverkraft-tech/ci-github-common](https://github.com/hoverkraft-tech/ci-github-common). Updates `hoverkraft-tech/ci-github-common/.github/workflows/greetings.yml` from 0.30.2 to 0.31.0 - [Release notes](https://github.com/hoverkraft-tech/ci-github-common/releases) - [Commits](hoverkraft-tech/ci-github-common@5e8d0e6...a55670b) Updates `hoverkraft-tech/ci-github-publish/.github/workflows/release-actions.yml` from 0.15.2 to 0.16.0 - [Release notes](https://github.com/hoverkraft-tech/ci-github-publish/releases) - [Commits](hoverkraft-tech/ci-github-publish@dbdcce2...ed864a8) Updates `hoverkraft-tech/ci-github-common/.github/workflows/need-fix-to-issue.yml` from 0.30.2 to 0.31.0 - [Release notes](https://github.com/hoverkraft-tech/ci-github-common/releases) - [Commits](hoverkraft-tech/ci-github-common@5e8d0e6...a55670b) Updates `hoverkraft-tech/ci-github-common/.github/workflows/semantic-pull-request.yml` from 0.30.2 to 0.31.0 - [Release notes](https://github.com/hoverkraft-tech/ci-github-common/releases) - [Commits](hoverkraft-tech/ci-github-common@5e8d0e6...a55670b) Updates `hoverkraft-tech/ci-github-common/.github/workflows/linter.yml` from 0.30.2 to 0.31.0 - [Release notes](https://github.com/hoverkraft-tech/ci-github-common/releases) - [Commits](hoverkraft-tech/ci-github-common@5e8d0e6...a55670b) Updates `hoverkraft-tech/ci-github-common/.github/workflows/stale.yml` from 0.30.2 to 0.31.0 - [Release notes](https://github.com/hoverkraft-tech/ci-github-common/releases) - [Commits](hoverkraft-tech/ci-github-common@5e8d0e6...a55670b) Updates `hoverkraft-tech/ci-github-container/.github/workflows/docker-build-images.yml` from 0.29.1 to 0.30.0 - [Release notes](https://github.com/hoverkraft-tech/ci-github-container/releases) - [Commits](hoverkraft-tech/ci-github-container@6b0d5ca...0d92511) Updates `hoverkraft-tech/ci-github-common` from 0.30.2 to 0.31.0 - [Release notes](https://github.com/hoverkraft-tech/ci-github-common/releases) - [Commits](hoverkraft-tech/ci-github-common@5e8d0e6...a55670b) Updates `hoverkraft-tech/ci-github-common` from 0.30.2 to 0.31.0 - [Release notes](https://github.com/hoverkraft-tech/ci-github-common/releases) - [Commits](hoverkraft-tech/ci-github-common@5e8d0e6...a55670b) Updates `hoverkraft-tech/ci-github-common` from 0.30.2 to 0.31.0 - [Release notes](https://github.com/hoverkraft-tech/ci-github-common/releases) - [Commits](hoverkraft-tech/ci-github-common@5e8d0e6...a55670b) --- updated-dependencies: - dependency-name: hoverkraft-tech/ci-github-common/.github/workflows/greetings.yml dependency-version: 0.31.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions-dependencies - dependency-name: hoverkraft-tech/ci-github-publish/.github/workflows/release-actions.yml dependency-version: 0.16.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions-dependencies - dependency-name: hoverkraft-tech/ci-github-common/.github/workflows/need-fix-to-issue.yml dependency-version: 0.31.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions-dependencies - dependency-name: hoverkraft-tech/ci-github-common/.github/workflows/semantic-pull-request.yml dependency-version: 0.31.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions-dependencies - dependency-name: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml dependency-version: 0.31.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions-dependencies - dependency-name: hoverkraft-tech/ci-github-common/.github/workflows/stale.yml dependency-version: 0.31.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions-dependencies - dependency-name: hoverkraft-tech/ci-github-container/.github/workflows/docker-build-images.yml dependency-version: 0.30.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions-dependencies - dependency-name: hoverkraft-tech/ci-github-common dependency-version: 0.31.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions-dependencies - dependency-name: hoverkraft-tech/ci-github-common dependency-version: 0.31.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions-dependencies - dependency-name: hoverkraft-tech/ci-github-common dependency-version: 0.31.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions-dependencies ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: Emilien Escalle <[email protected]>
1 parent 7d6c85d commit 7b366a2

File tree

11 files changed

+144
-105
lines changed

11 files changed

+144
-105
lines changed

.github/workflows/__greetings.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ permissions: {}
1010

1111
jobs:
1212
greetings:
13-
uses: hoverkraft-tech/ci-github-common/.github/workflows/greetings.yml@5e8d0e6d1e76d8577a070db6d0128a91b1c9d5ad # 0.30.2
13+
uses: hoverkraft-tech/ci-github-common/.github/workflows/greetings.yml@e6733528d06b6e1668674c35ef3612ac416cedda # 0.31.1
1414
permissions:
1515
contents: read
1616
issues: write

.github/workflows/__main-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
release:
3636
needs: ci
3737
if: github.event_name != 'schedule'
38-
uses: hoverkraft-tech/ci-github-publish/.github/workflows/release-actions.yml@dbdcce2870b33525ac1fa26069bf95b2dd586fda # 0.15.2
38+
uses: hoverkraft-tech/ci-github-publish/.github/workflows/release-actions.yml@ed864a88ec8610dc2a1b9aab1dbde2864bf75df4 # 0.16.0
3939
permissions:
4040
contents: read
4141
with:

.github/workflows/__need-fix-to-issue.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ permissions: {}
1818

1919
jobs:
2020
main:
21-
uses: hoverkraft-tech/ci-github-common/.github/workflows/need-fix-to-issue.yml@5e8d0e6d1e76d8577a070db6d0128a91b1c9d5ad # 0.30.2
21+
uses: hoverkraft-tech/ci-github-common/.github/workflows/need-fix-to-issue.yml@e6733528d06b6e1668674c35ef3612ac416cedda # 0.31.1
2222
permissions:
2323
contents: read
2424
issues: write

.github/workflows/__semantic-pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ permissions: {}
1212

1313
jobs:
1414
main:
15-
uses: hoverkraft-tech/ci-github-common/.github/workflows/semantic-pull-request.yml@5e8d0e6d1e76d8577a070db6d0128a91b1c9d5ad # 0.30.2
15+
uses: hoverkraft-tech/ci-github-common/.github/workflows/semantic-pull-request.yml@e6733528d06b6e1668674c35ef3612ac416cedda # 0.31.1
1616
permissions:
1717
contents: write
1818
pull-requests: write

.github/workflows/__shared-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ permissions: {}
77

88
jobs:
99
linter:
10-
uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@5e8d0e6d1e76d8577a070db6d0128a91b1c9d5ad # 0.30.2
10+
uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@e6733528d06b6e1668674c35ef3612ac416cedda # 0.31.1
1111
permissions:
1212
contents: read
1313
statuses: write

.github/workflows/__stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ permissions: {}
88

99
jobs:
1010
main:
11-
uses: hoverkraft-tech/ci-github-common/.github/workflows/stale.yml@5e8d0e6d1e76d8577a070db6d0128a91b1c9d5ad # 0.30.2
11+
uses: hoverkraft-tech/ci-github-common/.github/workflows/stale.yml@e6733528d06b6e1668674c35ef3612ac416cedda # 0.31.1
1212
permissions:
1313
issues: write
1414
pull-requests: write

.github/workflows/__test-workflow-continuous-integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
packages: write
6464
issues: read
6565
pull-requests: read
66-
uses: hoverkraft-tech/ci-github-container/.github/workflows/docker-build-images.yml@6b0d5ca498b7a533b43e1f2e8d988678d164a429 # 0.29.1
66+
uses: hoverkraft-tech/ci-github-container/.github/workflows/docker-build-images.yml@0d92511a38c93e30ae0f8b82346116946987a9ca # 0.30.0
6767
with:
6868
sign: false
6969
images: |

.github/workflows/continuous-integration.yml

Lines changed: 45 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ jobs:
293293
security-events: write
294294
runs-on: *ci-runner
295295
steps:
296-
- uses: hoverkraft-tech/ci-github-common/actions/checkout@5e8d0e6d1e76d8577a070db6d0128a91b1c9d5ad # 0.30.2
296+
- uses: hoverkraft-tech/ci-github-common/actions/checkout@e6733528d06b6e1668674c35ef3612ac416cedda # 0.31.1
297297
- uses: github/codeql-action/init@fdbfb4d2750291e159f0156def62b853c2798ca2 # v4.31.5
298298
with:
299299
languages: ${{ inputs.code-ql }}
@@ -306,7 +306,7 @@ jobs:
306306
contents: read
307307
runs-on: *ci-runner
308308
steps:
309-
- uses: hoverkraft-tech/ci-github-common/actions/checkout@5e8d0e6d1e76d8577a070db6d0128a91b1c9d5ad # 0.30.2
309+
- uses: hoverkraft-tech/ci-github-common/actions/checkout@e6733528d06b6e1668674c35ef3612ac416cedda # 0.31.1
310310
- uses: actions/dependency-review-action@3c4e3dcb1aa7874d2c16be7d79418e9b7efd6261 # v4.8.2
311311

312312
setup:
@@ -334,7 +334,7 @@ jobs:
334334
steps:
335335
- name: Checkout repository
336336
if: inputs.container == ''
337-
uses: hoverkraft-tech/ci-github-common/actions/checkout@5e8d0e6d1e76d8577a070db6d0128a91b1c9d5ad # 0.30.2
337+
uses: hoverkraft-tech/ci-github-common/actions/checkout@e6733528d06b6e1668674c35ef3612ac416cedda # 0.31.1
338338

339339
- id: working-directory
340340
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
@@ -458,24 +458,15 @@ jobs:
458458
permissions:
459459
contents: read
460460
packages: read
461-
# FIXME: This is a workaround for having workflow ref. See https://github.com/orgs/community/discussions/38659
462-
id-token: write
461+
id-token: write # Needed for getting local workflow actions
463462
steps:
464-
- uses: hoverkraft-tech/ci-github-common/actions/checkout@5e8d0e6d1e76d8577a070db6d0128a91b1c9d5ad # 0.30.2
463+
- uses: hoverkraft-tech/ci-github-common/actions/checkout@e6733528d06b6e1668674c35ef3612ac416cedda # 0.31.1
465464
if: inputs.container == ''
466465

467-
- id: oidc
468-
uses: ChristopherHX/oidc@73eee1ff03fdfce10eda179f617131532209edbd # v3
469-
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
466+
- id: local-workflow-actions
467+
uses: hoverkraft-tech/ci-github-common/actions/local-workflow-actions@e6733528d06b6e1668674c35ef3612ac416cedda # 0.31.1
470468
with:
471-
path: ./self-workflow
472-
repository: ${{ steps.oidc.outputs.job_workflow_repo_name_and_owner }}
473-
ref: ${{ steps.oidc.outputs.job_workflow_repo_ref }}
474-
sparse-checkout: |
475-
actions
476-
- run: |
477-
if [ -f .gitignore ]; then grep -q "self-workflow" .gitignore || echo "self-workflow" >> .gitignore; else echo "self-workflow" >> .gitignore; fi
478-
if [ -f .dockerignore ]; then grep -q "self-workflow" .dockerignore || echo "self-workflow" >> .dockerignore; else echo "self-workflow" >> .dockerignore; fi
469+
actions-path: actions
479470

480471
- id: preparel-lint-options
481472
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
@@ -508,6 +499,15 @@ jobs:
508499
report-file: ${{ steps.preparel-lint-options.outputs.report-file }}
509500
path-mapping: ${{ needs.prepare.outputs.path-mapping || '' }}
510501

502+
# jscpd:ignore-start
503+
- uses: hoverkraft-tech/ci-github-common/actions/local-workflow-actions@e6733528d06b6e1668674c35ef3612ac416cedda # 0.31.1
504+
if: always() && steps.local-workflow-actions.outputs.repository
505+
with:
506+
actions-path: actions
507+
repository: ${{ steps.local-workflow-actions.outputs.repository }}
508+
ref: ${{ steps.local-workflow-actions.outputs.ref }}
509+
# jscpd:ignore-end
510+
511511
build:
512512
if: inputs.checks == true
513513
name: 🏗️ Build
@@ -519,30 +519,17 @@ jobs:
519519
permissions:
520520
contents: read
521521
packages: read
522-
# FIXME: This is a workaround for having workflow ref. See https://github.com/orgs/community/discussions/38659
523-
id-token: write
522+
id-token: write # Needed for getting local workflow actions
524523
outputs:
525524
artifact-id: ${{ steps.build.outputs.artifact-id }}
526525
steps:
527-
- uses: hoverkraft-tech/ci-github-common/actions/checkout@5e8d0e6d1e76d8577a070db6d0128a91b1c9d5ad # 0.30.2
526+
- uses: hoverkraft-tech/ci-github-common/actions/checkout@e6733528d06b6e1668674c35ef3612ac416cedda # 0.31.1
528527
if: needs.setup.outputs.build-commands && inputs.container == ''
529528

530-
# FIXME: This is a workaround for having workflow ref. See https://github.com/orgs/community/discussions/38659
531-
- id: oidc
532-
if: needs.setup.outputs.build-commands
533-
uses: ChristopherHX/oidc@73eee1ff03fdfce10eda179f617131532209edbd # v3
534-
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
535-
if: needs.setup.outputs.build-commands
529+
- id: local-workflow-actions
530+
uses: hoverkraft-tech/ci-github-common/actions/local-workflow-actions@e6733528d06b6e1668674c35ef3612ac416cedda # 0.31.1
536531
with:
537-
path: ./self-workflow
538-
repository: ${{ steps.oidc.outputs.job_workflow_repo_name_and_owner }}
539-
ref: ${{ steps.oidc.outputs.job_workflow_repo_ref }}
540-
sparse-checkout: |
541-
actions
542-
- if: needs.setup.outputs.build-commands
543-
run: |
544-
if [ -f .gitignore ]; then grep -q "self-workflow" .gitignore || echo "self-workflow" >> .gitignore; else echo "self-workflow" >> .gitignore; fi
545-
if [ -f .dockerignore ]; then grep -q "self-workflow" .dockerignore || echo "self-workflow" >> .dockerignore; else echo "self-workflow" >> .dockerignore; fi
532+
actions-path: actions
546533

547534
- id: build
548535
if: needs.setup.outputs.build-commands
@@ -555,6 +542,15 @@ jobs:
555542
build-env: ${{ needs.setup.outputs.build-env }}
556543
build-artifact: ${{ needs.setup.outputs.build-artifact }}
557544

545+
# jscpd:ignore-start
546+
- uses: hoverkraft-tech/ci-github-common/actions/local-workflow-actions@e6733528d06b6e1668674c35ef3612ac416cedda # 0.31.1
547+
if: always() && steps.local-workflow-actions.outputs.repository
548+
with:
549+
actions-path: actions
550+
repository: ${{ steps.local-workflow-actions.outputs.repository }}
551+
ref: ${{ steps.local-workflow-actions.outputs.ref }}
552+
# jscpd:ignore-end
553+
558554
test:
559555
if: inputs.checks == true && inputs.test
560556
name: 🧪 Test
@@ -568,10 +564,9 @@ jobs:
568564
contents: read
569565
pull-requests: write
570566
packages: read
571-
# FIXME: This is a workaround for having workflow ref. See https://github.com/orgs/community/discussions/38659
572-
id-token: write
567+
id-token: write # Needed for getting local workflow actions
573568
steps:
574-
- uses: hoverkraft-tech/ci-github-common/actions/checkout@5e8d0e6d1e76d8577a070db6d0128a91b1c9d5ad # 0.30.2
569+
- uses: hoverkraft-tech/ci-github-common/actions/checkout@e6733528d06b6e1668674c35ef3612ac416cedda # 0.31.1
575570
if: inputs.container == ''
576571

577572
- if: needs.build.outputs.artifact-id && inputs.container == ''
@@ -580,19 +575,10 @@ jobs:
580575
artifact-ids: ${{ needs.build.outputs.artifact-id }}
581576
path: "/"
582577

583-
# FIXME: This is a workaround for having workflow ref. See https://github.com/orgs/community/discussions/38659
584-
- id: oidc
585-
uses: ChristopherHX/oidc@73eee1ff03fdfce10eda179f617131532209edbd # v3
586-
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
578+
- id: local-workflow-actions
579+
uses: hoverkraft-tech/ci-github-common/actions/local-workflow-actions@e6733528d06b6e1668674c35ef3612ac416cedda # 0.31.1
587580
with:
588-
path: ./self-workflow
589-
repository: ${{ steps.oidc.outputs.job_workflow_repo_name_and_owner }}
590-
ref: ${{ steps.oidc.outputs.job_workflow_repo_ref }}
591-
sparse-checkout: |
592-
actions
593-
- run: |
594-
if [ -f .gitignore ]; then grep -q "self-workflow" .gitignore || echo "self-workflow" >> .gitignore; else echo "self-workflow" >> .gitignore; fi
595-
if [ -f .dockerignore ]; then grep -q "self-workflow" .dockerignore || echo "self-workflow" >> .dockerignore; else echo "self-workflow" >> .dockerignore; fi
581+
actions-path: actions
596582

597583
- id: prepare-test-options
598584
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
@@ -630,3 +616,12 @@ jobs:
630616
report-file: ${{ steps.prepare-test-options.outputs.report-file }}
631617
path-mapping: ${{ needs.prepare.outputs.path-mapping || '' }}
632618
github-token: ${{ secrets.github-token || github.token }}
619+
620+
# jscpd:ignore-start
621+
- uses: hoverkraft-tech/ci-github-common/actions/local-workflow-actions@e6733528d06b6e1668674c35ef3612ac416cedda # 0.31.1
622+
if: always() && steps.local-workflow-actions.outputs.repository
623+
with:
624+
actions-path: actions
625+
repository: ${{ steps.local-workflow-actions.outputs.repository }}
626+
ref: ${{ steps.local-workflow-actions.outputs.ref }}
627+
# jscpd:ignore-end

actions/codecov/action.yml

Lines changed: 89 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -51,58 +51,103 @@ runs:
5151
with:
5252
+: ${{ steps.check-codecov-deps.outputs.missing-deps }}
5353

54-
# Fix pkgxdev gnupg's gpgconf.ctl which contains unexpanded environment variables
55-
- name: Fix GPG configuration
56-
if: contains(steps.check-codecov-deps.outputs.missing-deps, 'gnupg.org')
54+
- name: Fix unexpanded environment variables
55+
if: steps.check-codecov-deps.outputs.missing-deps
5756
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
5857
with:
5958
script: |
60-
const fs = require('node:fs');
61-
const path = require('node:path');
62-
const os = require('node:os');
63-
64-
// Find and remove the malformed gpgconf.ctl file that contains unexpanded shell variables
65-
// The pkgxdev gnupg installs gpgconf.ctl next to the gpgconf binary
66-
try {
67-
const gpgconfPath = await io.which('gpgconf', false);
68-
if (gpgconfPath) {
69-
const gpgconfCtl = path.join(path.dirname(gpgconfPath), 'gpgconf.ctl');
70-
if (fs.existsSync(gpgconfCtl)) {
71-
core.info(`Removing malformed gpgconf.ctl: ${gpgconfCtl}`);
72-
await io.rmRF(gpgconfCtl);
73-
}
59+
const templatePattern = /\$\{([^}:]+)(?::-([^}]*))?\}/g;
60+
const unsafeSyntaxPattern = /`|\$\(/;
61+
const resolving = new Set();
62+
const resolvedCache = new Map();
63+
64+
const hasTemplate = (value) => {
65+
if (typeof value !== 'string') {
66+
return false;
7467
}
75-
} catch (error) {
76-
core.warning(`Failed to check/remove gpgconf.ctl: ${error.message}`);
77-
}
7868
79-
// Ensure GNUPGHOME is set up correctly
80-
const gnupgHome = path.join(os.homedir(), '.gnupg');
81-
await io.mkdirP(gnupgHome);
82-
fs.chmodSync(gnupgHome, 0o700);
69+
templatePattern.lastIndex = 0;
70+
return templatePattern.test(value);
71+
};
8372
84-
# Fix pkgxdev curl's .curlrc which contains unexpanded environment variables
85-
- name: Fix curl configuration
86-
if: contains(steps.check-codecov-deps.outputs.missing-deps, 'curl')
87-
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
88-
with:
89-
script: |
90-
const fs = require('node:fs');
91-
const path = require('node:path');
92-
93-
// Find and fix the .curlrc file that contains unexpanded shell variables like ${SSL_CERT_FILE:-...}
94-
// The pkgxdev curl installs .curlrc next to the curl binary
95-
try {
96-
const curlPath = await io.which('curl', false);
97-
if (curlPath) {
98-
const curlrc = path.join(path.dirname(curlPath), '.curlrc');
99-
if (fs.existsSync(curlrc)) {
100-
core.info(`Removing malformed .curlrc: ${curlrc}`);
101-
await io.rmRF(curlrc);
73+
const getReferencedVariables = (value) => {
74+
templatePattern.lastIndex = 0;
75+
return Array.from(value.matchAll(templatePattern), (match) => match[1]);
76+
};
77+
78+
const sanitizeForDoubleQuotes = (value) => value.replace(/(["\\])/g, '\\$1');
79+
80+
const resolveEnvVariable = async (envKey) => {
81+
const rawValue = process.env[envKey];
82+
83+
if (!hasTemplate(rawValue)) {
84+
core.debug(`Skipping ${envKey} because it does not match the template pattern.`);
85+
return rawValue;
86+
}
87+
88+
if (unsafeSyntaxPattern.test(rawValue)) {
89+
core.debug(`Skipping ${envKey} because it contains unsupported command substitution syntax.`);
90+
return rawValue;
91+
}
92+
93+
if (resolvedCache.has(envKey)) {
94+
return resolvedCache.get(envKey);
95+
}
96+
97+
if (resolving.has(envKey)) {
98+
core.debug(`Detected circular reference while resolving ${envKey}, falling back to defaults.`);
99+
return rawValue;
100+
}
101+
102+
resolving.add(envKey);
103+
104+
const referencedVariables = getReferencedVariables(rawValue);
105+
for (const variableName of referencedVariables) {
106+
if (variableName === envKey) {
107+
continue;
102108
}
109+
110+
await resolveEnvVariable(variableName);
103111
}
104-
} catch (error) {
105-
core.warning(`Failed to check/remove .curlrc: ${error.message}`);
112+
113+
const envForBash = { ...process.env };
114+
delete envForBash[envKey];
115+
116+
const scriptLines = [
117+
'set -eo pipefail',
118+
`resolved_value="${sanitizeForDoubleQuotes(rawValue)}"`,
119+
"printf '%s' \"${resolved_value}\"",
120+
];
121+
122+
let resolvedValue = rawValue;
123+
try {
124+
const { stdout } = await exec.getExecOutput(
125+
'bash',
126+
['-c', scriptLines.join('\n')],
127+
{ env: envForBash, silent: true }
128+
);
129+
130+
resolvedValue = stdout.replace(/\r?\n$/, '');
131+
} catch (error) {
132+
core.warning(`Failed to resolve ${envKey}: ${error.message}`);
133+
}
134+
135+
resolving.delete(envKey);
136+
resolvedCache.set(envKey, resolvedValue);
137+
138+
if (resolvedValue !== rawValue) {
139+
core.debug(`Resolved ${envKey}: "${rawValue}" -> "${resolvedValue}"`);
140+
process.env[envKey] = resolvedValue;
141+
core.exportVariable(envKey, resolvedValue);
142+
} else {
143+
core.debug(`No changes for ${envKey}, skipping update.`);
144+
}
145+
146+
return resolvedValue;
147+
};
148+
149+
for (const envKey of Object.keys(process.env)) {
150+
await resolveEnvVariable(envKey);
106151
}
107152
108153
- name: 📊 Upload coverage to Codecov

actions/lint/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ runs:
103103
104104
- name: 📊 Parse lint reports
105105
if: always()
106-
uses: hoverkraft-tech/ci-github-common/actions/parse-ci-reports@5e8d0e6d1e76d8577a070db6d0128a91b1c9d5ad # 0.30.2
106+
uses: hoverkraft-tech/ci-github-common/actions/parse-ci-reports@e6733528d06b6e1668674c35ef3612ac416cedda # 0.31.1
107107
with:
108108
working-directory: ${{ inputs.working-directory }}
109109
report-paths: ${{ inputs.report-file || 'auto:lint' }}

0 commit comments

Comments
 (0)