Skip to content

Commit f7d25a9

Browse files
⚠️[Security fix] - Code injection and unsafe code execution (#2)
- Fixing #9 , by [using an intermediate environment variable](https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable). - Fixing #10 , by changing the workflow to trigger on [pull_request_target](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target)
1 parent b912802 commit f7d25a9

File tree

4 files changed

+27
-5
lines changed

4 files changed

+27
-5
lines changed

.github/workflows/Auto-Release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Auto-Release
22

33
on:
4-
pull_request:
4+
pull_request_target:
55
branches:
66
- main
77
types:

.github/workflows/Linter.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
name: Linter
22

33
on:
4-
pull_request:
4+
pull_request_target:
5+
branches:
6+
- main
57

68
jobs:
79
Lint:

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Automatically creates releases based on pull requests and labels.
55
## Specifications and practices
66

77
Auto-Release follows:
8+
Test
89

910
- [SemVer 2.0.0 specifications](https://semver.org)
1011
- [GitHub Flow specifications](https://docs.github.com/en/get-started/using-github/github-flow)

action.yml

+22-3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ runs:
2424
steps:
2525
- name: Auto-Release
2626
shell: pwsh
27+
env:
28+
GITHUB_CONTEXT: ${{ toJson(github) }}
29+
JOB_CONTEXT: ${{ toJson(job) }}
30+
RUNNER_CONTEXT: ${{ toJson(runner) }}
31+
AutoPatching: ${{ inputs.AutoPatching }}
32+
IncrementalPrerelease: ${{ inputs.IncrementalPrerelease }}
33+
VersionPrefix: ${{ inputs.VersionPrefix }}
2734
run: |
2835
# Auto-Release
2936
Write-Host "::group::Utilities"
@@ -43,9 +50,21 @@ runs:
4350
Get-ChildItem -Path Env: | Select-Object Name, Value | Sort-Object Name | Format-Table -AutoSize
4451
Write-Host '::endgroup::'
4552
46-
$autoPatching = '${{ inputs.AutoPatching }}' -eq 'true'
47-
$incrementalPrerelease = '${{ inputs.IncrementalPrerelease }}' -eq 'true'
48-
$versionPrefix = '${{ inputs.VersionPrefix }}'
53+
Write-Host "::group::GitHub context"
54+
Write-Host $env:GITHUB_CONTEXT
55+
Write-Host '::endgroup::'
56+
57+
Write-Host "::group::Job context"
58+
Write-Host $env:JOB_CONTEXT
59+
Write-Host '::endgroup::'
60+
61+
Write-Host "::group::Runner context"
62+
Write-Host $env:RUNNER_CONTEXT
63+
Write-Host '::endgroup::'
64+
65+
$autoPatching = $env:AutoPatching -eq 'true'
66+
$incrementalPrerelease = $env:IncrementalPrerelease -eq 'true'
67+
$versionPrefix = $env:VersionPrefix
4968
Write-Host "-------------------------------------------------"
5069
Write-Host "Auto patching enabled: [$autoPatching]"
5170
Write-Host "Incremental prerelease enabled: [$autoPatching]"

0 commit comments

Comments
 (0)