neiam
/action-setup-beam
action-setup-beam
public · Issues · Pulls · Labels · Forks · Compare · Actions queued
⭐
Log in to mark this repository.
Act on CodeQL's suggestions for tightening security / improving performance (#338)
65066e3 · Paulo F. Oliveira · 2025-05-30 00:57
Message
{commit_body(@commit)}
Files changed
modified
.github/workflows/action.yml
+3
−6
@@ -1,6 +1,9 @@
| 1 | 1 | --- |
| 2 | 2 | name: action |
| 3 | 3 | |
| 4 | +permissions: | |
| 5 | + contents: read | |
| 6 | + | |
| 4 | 7 | on: |
| 5 | 8 | push: |
| 6 | 9 | branches: |
@@ -41,8 +44,6 @@ jobs:
| 41 | 44 | name: Expected local npm actions |
| 42 | 45 | runs-on: ubuntu-latest |
| 43 | 46 | if: github.ref != 'refs/heads/main' |
| 44 | − permissions: | |
| 45 | − contents: read | |
| 46 | 47 | steps: |
| 47 | 48 | - uses: actions/checkout@v4 |
| 48 | 49 | - uses: actions/setup-node@v4 |
@@ -56,8 +57,6 @@ jobs:
| 56 | 57 | name: Action |
| 57 | 58 | runs-on: ubuntu-latest |
| 58 | 59 | if: github.ref != 'refs/heads/main' |
| 59 | − permissions: | |
| 60 | − contents: read | |
| 61 | 60 | steps: |
| 62 | 61 | - uses: actions/checkout@v4 |
| 63 | 62 | - uses: raven-actions/actionlint@v2 |
@@ -94,8 +93,6 @@ jobs:
| 94 | 93 | unit_tests_macos: |
| 95 | 94 | name: Unit tests (macOS) |
| 96 | 95 | runs-on: macos-latest |
| 97 | − permissions: | |
| 98 | − contents: read | |
| 99 | 96 | steps: |
| 100 | 97 | - uses: actions/checkout@v4 |
| 101 | 98 | - uses: actions/setup-node@v4 |
modified
.github/workflows/hexpm-mirrors.yml
+3
−0
@@ -1,6 +1,9 @@
| 1 | 1 | --- |
| 2 | 2 | name: hexpm-mirrors |
| 3 | 3 | |
| 4 | +permissions: | |
| 5 | + contents: read | |
| 6 | + | |
| 4 | 7 | on: |
| 5 | 8 | push: |
| 6 | 9 | branches: |
modified
.github/workflows/macos.yml
+1
−0
@@ -1,5 +1,6 @@
| 1 | 1 | --- |
| 2 | 2 | name: macos |
| 3 | + | |
| 3 | 4 | permissions: |
| 4 | 5 | contents: read |
| 5 | 6 |
modified
.github/workflows/ubuntu.yml
+3
−0
@@ -1,6 +1,9 @@
| 1 | 1 | --- |
| 2 | 2 | name: ubuntu |
| 3 | 3 | |
| 4 | +permissions: | |
| 5 | + contents: read | |
| 6 | + | |
| 4 | 7 | on: |
| 5 | 8 | push: |
| 6 | 9 | branches: |
modified
.github/workflows/update_3rd_party_licenses.yml
+3
−0
@@ -1,6 +1,9 @@
| 1 | 1 | --- |
| 2 | 2 | name: Update 3rd party licenses (automation) |
| 3 | 3 | |
| 4 | +permissions: | |
| 5 | + contents: write | |
| 6 | + | |
| 4 | 7 | on: |
| 5 | 8 | schedule: |
| 6 | 9 | - cron: '0 12 * * *' |
modified
.github/workflows/windows.yml
+3
−0
@@ -1,6 +1,9 @@
| 1 | 1 | --- |
| 2 | 2 | name: windows |
| 3 | 3 | |
| 4 | +permissions: | |
| 5 | + contents: read | |
| 6 | + | |
| 4 | 7 | on: |
| 5 | 8 | push: |
| 6 | 9 | branches: |
modified
dist/index.js
+4
−3
@@ -26068,10 +26068,11 @@ function requestedVersionFor(tool, version, originListing, mirrors) {
| 26068 | 26068 | } |
| 26069 | 26069 | |
| 26070 | 26070 | async function getElixirVersion(exSpec0, otpVersion0) { |
| 26071 | − const otpVersion = otpVersion0.match(/^([^-]+-)?(.+)$/)[2] | |
| 26071 | + const otpVersion = otpVersion0.match(/^(?:OTP-)?(.+)$/)[1] | |
| 26072 | 26072 | let otpVersionMajor = otpVersion.match(/^([^.]+).*$/)[1] |
| 26073 | 26073 | |
| 26074 | − const userSuppliedOtp = exSpec0.match(/-otp-(\d+)/)?.[1] ?? null | |
| 26074 | + const otpSuffix = /-otp-(\d+)/ | |
| 26075 | + const userSuppliedOtp = exSpec0.match(otpSuffix)?.[1] ?? null | |
| 26075 | 26076 | |
| 26076 | 26077 | if (userSuppliedOtp && isVersion(userSuppliedOtp)) { |
| 26077 | 26078 | otpVersionMajor = userSuppliedOtp |
@@ -26079,7 +26080,7 @@ async function getElixirVersion(exSpec0, otpVersion0) {
| 26079 | 26080 | |
| 26080 | 26081 | const [otpVersionsForElixirMap, elixirVersions, originListing, hexMirrors] = |
| 26081 | 26082 | await getElixirVersions() |
| 26082 | − const spec = exSpec0.replace(/-otp-.*$/, '') | |
| 26083 | + const spec = exSpec0.replace(otpSuffix, '') | |
| 26083 | 26084 | const versions = elixirVersions |
| 26084 | 26085 | const elixirVersionFromSpec = getVersionFromSpec(spec, versions) |
| 26085 | 26086 |
modified
src/setup-beam.js
+4
−3
@@ -193,10 +193,11 @@ function requestedVersionFor(tool, version, originListing, mirrors) {
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | async function getElixirVersion(exSpec0, otpVersion0) { |
| 196 | − const otpVersion = otpVersion0.match(/^([^-]+-)?(.+)$/)[2] | |
| 196 | + const otpVersion = otpVersion0.match(/^(?:OTP-)?(.+)$/)[1] | |
| 197 | 197 | let otpVersionMajor = otpVersion.match(/^([^.]+).*$/)[1] |
| 198 | 198 | |
| 199 | − const userSuppliedOtp = exSpec0.match(/-otp-(\d+)/)?.[1] ?? null | |
| 199 | + const otpSuffix = /-otp-(\d+)/ | |
| 200 | + const userSuppliedOtp = exSpec0.match(otpSuffix)?.[1] ?? null | |
| 200 | 201 | |
| 201 | 202 | if (userSuppliedOtp && isVersion(userSuppliedOtp)) { |
| 202 | 203 | otpVersionMajor = userSuppliedOtp |
@@ -204,7 +205,7 @@ async function getElixirVersion(exSpec0, otpVersion0) {
| 204 | 205 | |
| 205 | 206 | const [otpVersionsForElixirMap, elixirVersions, originListing, hexMirrors] = |
| 206 | 207 | await getElixirVersions() |
| 207 | − const spec = exSpec0.replace(/-otp-.*$/, '') | |
| 208 | + const spec = exSpec0.replace(otpSuffix, '') | |
| 208 | 209 | const versions = elixirVersions |
| 209 | 210 | const elixirVersionFromSpec = getVersionFromSpec(spec, versions) |
| 210 | 211 |
Parents: 889e64e