mirror of
https://github.com/actions/runner.git
synced 2025-12-13 00:36:29 +00:00
Compare commits
1 Commits
chore/npm-
...
chore/npm-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
320c92d1a8 |
2
.github/workflows/dependency-check.yml
vendored
2
.github/workflows/dependency-check.yml
vendored
@@ -31,7 +31,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v5
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: "20"
|
node-version: "20"
|
||||||
|
|
||||||
|
|||||||
84
.github/workflows/node-upgrade.yml
vendored
84
.github/workflows/node-upgrade.yml
vendored
@@ -32,47 +32,20 @@ jobs:
|
|||||||
echo "Verifying availability in alpine_nodejs..."
|
echo "Verifying availability in alpine_nodejs..."
|
||||||
ALPINE_RELEASES=$(curl -s https://api.github.com/repos/actions/alpine_nodejs/releases | jq -r '.[].tag_name')
|
ALPINE_RELEASES=$(curl -s https://api.github.com/repos/actions/alpine_nodejs/releases | jq -r '.[].tag_name')
|
||||||
|
|
||||||
if ! echo "$ALPINE_RELEASES" | grep -q "^v$LATEST_NODE20$"; then
|
if ! echo "$ALPINE_RELEASES" | grep -q "^node20-$LATEST_NODE20$"; then
|
||||||
echo "::warning title=Node 20 Fallback::Node 20 version $LATEST_NODE20 not found in alpine_nodejs releases, using fallback"
|
echo "::warning title=Node 20 Fallback::Node 20 version $LATEST_NODE20 not found in alpine_nodejs releases, using fallback"
|
||||||
# Fall back to latest available alpine_nodejs v20 release
|
# Fall back to latest available alpine_nodejs v20 release
|
||||||
LATEST_NODE20=$(echo "$ALPINE_RELEASES" | grep "^v20\." | head -1 | sed 's/^v//')
|
LATEST_NODE20=$(echo "$ALPINE_RELEASES" | grep "^node20-" | head -1 | sed 's/^node20-//')
|
||||||
echo "Using latest available alpine_nodejs Node 20: $LATEST_NODE20"
|
echo "Using latest available alpine_nodejs Node 20: $LATEST_NODE20"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! echo "$ALPINE_RELEASES" | grep -q "^v$LATEST_NODE24$"; then
|
if ! echo "$ALPINE_RELEASES" | grep -q "^node24-$LATEST_NODE24$"; then
|
||||||
echo "::warning title=Node 24 Fallback::Node 24 version $LATEST_NODE24 not found in alpine_nodejs releases, using fallback"
|
echo "::warning title=Node 24 Fallback::Node 24 version $LATEST_NODE24 not found in alpine_nodejs releases, using fallback"
|
||||||
# Fall back to latest available alpine_nodejs v24 release
|
# Fall back to latest available alpine_nodejs v24 release
|
||||||
LATEST_NODE24=$(echo "$ALPINE_RELEASES" | grep "^v24\." | head -1 | sed 's/^v//')
|
LATEST_NODE24=$(echo "$ALPINE_RELEASES" | grep "^node24-" | head -1 | sed 's/^node24-//')
|
||||||
echo "Using latest available alpine_nodejs Node 24: $LATEST_NODE24"
|
echo "Using latest available alpine_nodejs Node 24: $LATEST_NODE24"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Validate that we have non-empty version numbers
|
|
||||||
if [ -z "$LATEST_NODE20" ] || [ "$LATEST_NODE20" = "" ]; then
|
|
||||||
echo "::error title=Invalid Node 20 Version::Failed to determine valid Node 20 version. Got: '$LATEST_NODE20'"
|
|
||||||
echo "Available alpine_nodejs releases:"
|
|
||||||
echo "$ALPINE_RELEASES" | head -10
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$LATEST_NODE24" ] || [ "$LATEST_NODE24" = "" ]; then
|
|
||||||
echo "::error title=Invalid Node 24 Version::Failed to determine valid Node 24 version. Got: '$LATEST_NODE24'"
|
|
||||||
echo "Available alpine_nodejs releases:"
|
|
||||||
echo "$ALPINE_RELEASES" | head -10
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Additional validation: ensure versions match expected format (x.y.z)
|
|
||||||
if ! echo "$LATEST_NODE20" | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$'; then
|
|
||||||
echo "::error title=Invalid Node 20 Format::Node 20 version '$LATEST_NODE20' does not match expected format (x.y.z)"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! echo "$LATEST_NODE24" | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$'; then
|
|
||||||
echo "::error title=Invalid Node 24 Format::Node 24 version '$LATEST_NODE24' does not match expected format (x.y.z)"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "✅ Validated Node versions: 20=$LATEST_NODE20, 24=$LATEST_NODE24"
|
|
||||||
echo "latest_node20=$LATEST_NODE20" >> $GITHUB_OUTPUT
|
echo "latest_node20=$LATEST_NODE20" >> $GITHUB_OUTPUT
|
||||||
echo "latest_node24=$LATEST_NODE24" >> $GITHUB_OUTPUT
|
echo "latest_node24=$LATEST_NODE24" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
@@ -109,50 +82,13 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
# Final validation before making changes
|
|
||||||
NODE20_VERSION="${{ steps.node-versions.outputs.latest_node20 }}"
|
|
||||||
NODE24_VERSION="${{ steps.node-versions.outputs.latest_node24 }}"
|
|
||||||
|
|
||||||
echo "Final validation of versions before PR creation:"
|
|
||||||
echo "Node 20: '$NODE20_VERSION'"
|
|
||||||
echo "Node 24: '$NODE24_VERSION'"
|
|
||||||
|
|
||||||
# Validate versions are not empty and match expected format
|
|
||||||
if [ -z "$NODE20_VERSION" ] || ! echo "$NODE20_VERSION" | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$'; then
|
|
||||||
echo "::error title=Invalid Node 20 Version::Refusing to create PR with invalid Node 20 version: '$NODE20_VERSION'"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$NODE24_VERSION" ] || ! echo "$NODE24_VERSION" | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$'; then
|
|
||||||
echo "::error title=Invalid Node 24 Version::Refusing to create PR with invalid Node 24 version: '$NODE24_VERSION'"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "✅ All versions validated successfully"
|
|
||||||
|
|
||||||
# Update the files
|
# Update the files
|
||||||
if [ "${{ steps.node-versions.outputs.needs_update20 }}" == "true" ]; then
|
if [ "${{ steps.node-versions.outputs.needs_update20 }}" == "true" ]; then
|
||||||
sed -i 's/NODE20_VERSION="[^"]*"/NODE20_VERSION="'"$NODE20_VERSION"'"/' src/Misc/externals.sh
|
sed -i 's/NODE20_VERSION="[^"]*"/NODE20_VERSION="${{ steps.node-versions.outputs.latest_node20 }}"/' src/Misc/externals.sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${{ steps.node-versions.outputs.needs_update24 }}" == "true" ]; then
|
if [ "${{ steps.node-versions.outputs.needs_update24 }}" == "true" ]; then
|
||||||
sed -i 's/NODE24_VERSION="[^"]*"/NODE24_VERSION="'"$NODE24_VERSION"'"/' src/Misc/externals.sh
|
sed -i 's/NODE24_VERSION="[^"]*"/NODE24_VERSION="${{ steps.node-versions.outputs.latest_node24 }}"/' src/Misc/externals.sh
|
||||||
fi
|
|
||||||
|
|
||||||
# Verify the changes were applied correctly
|
|
||||||
echo "Verifying changes in externals.sh:"
|
|
||||||
grep "NODE20_VERSION=" src/Misc/externals.sh
|
|
||||||
grep "NODE24_VERSION=" src/Misc/externals.sh
|
|
||||||
|
|
||||||
# Ensure we actually have valid versions in the file
|
|
||||||
UPDATED_NODE20=$(grep "NODE20_VERSION=" src/Misc/externals.sh | cut -d'"' -f2)
|
|
||||||
UPDATED_NODE24=$(grep "NODE24_VERSION=" src/Misc/externals.sh | cut -d'"' -f2)
|
|
||||||
|
|
||||||
if [ -z "$UPDATED_NODE20" ] || [ -z "$UPDATED_NODE24" ]; then
|
|
||||||
echo "::error title=Update Failed::Failed to properly update externals.sh"
|
|
||||||
echo "Updated Node 20: '$UPDATED_NODE20'"
|
|
||||||
echo "Updated Node 24: '$UPDATED_NODE24'"
|
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Configure git
|
# Configure git
|
||||||
@@ -162,15 +98,15 @@ jobs:
|
|||||||
# Create branch and commit changes
|
# Create branch and commit changes
|
||||||
branch_name="chore/update-node"
|
branch_name="chore/update-node"
|
||||||
git checkout -b "$branch_name"
|
git checkout -b "$branch_name"
|
||||||
git commit -a -m "chore: update Node versions (20: $NODE20_VERSION, 24: $NODE24_VERSION)"
|
git commit -a -m "chore: update Node versions (20: ${{ steps.node-versions.outputs.latest_node20 }}, 24: ${{ steps.node-versions.outputs.latest_node24 }})"
|
||||||
git push --force origin "$branch_name"
|
git push --force origin "$branch_name"
|
||||||
|
|
||||||
# Create PR body using here-doc for proper formatting
|
# Create PR body using here-doc for proper formatting
|
||||||
cat > pr_body.txt << EOF
|
cat > pr_body.txt << 'EOF'
|
||||||
Automated Node.js version update:
|
Automated Node.js version update:
|
||||||
|
|
||||||
- Node 20: ${{ steps.node-versions.outputs.current_node20 }} → $NODE20_VERSION
|
- Node 20: ${{ steps.node-versions.outputs.current_node20 }} → ${{ steps.node-versions.outputs.latest_node20 }}
|
||||||
- Node 24: ${{ steps.node-versions.outputs.current_node24 }} → $NODE24_VERSION
|
- Node 24: ${{ steps.node-versions.outputs.current_node24 }} → ${{ steps.node-versions.outputs.latest_node24 }}
|
||||||
|
|
||||||
This update ensures we're using the latest stable Node.js versions for security and performance improvements.
|
This update ensures we're using the latest stable Node.js versions for security and performance improvements.
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/npm-audit-typescript.yml
vendored
2
.github/workflows/npm-audit-typescript.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v5
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: "20"
|
node-version: "20"
|
||||||
- name: NPM install and audit fix with TypeScript auto-repair
|
- name: NPM install and audit fix with TypeScript auto-repair
|
||||||
|
|||||||
2
.github/workflows/npm-audit.yml
vendored
2
.github/workflows/npm-audit.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v5
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: "20"
|
node-version: "20"
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ NODE_ALPINE_URL=https://github.com/actions/alpine_nodejs/releases/download
|
|||||||
# When you update Node versions you must also create a new release of alpine_nodejs at that updated version.
|
# When you update Node versions you must also create a new release of alpine_nodejs at that updated version.
|
||||||
# Follow the instructions here: https://github.com/actions/alpine_nodejs?tab=readme-ov-file#getting-started
|
# Follow the instructions here: https://github.com/actions/alpine_nodejs?tab=readme-ov-file#getting-started
|
||||||
NODE20_VERSION="20.19.5"
|
NODE20_VERSION="20.19.5"
|
||||||
NODE24_VERSION="24.9.0"
|
NODE24_VERSION="24.7.0"
|
||||||
|
|
||||||
get_abs_path() {
|
get_abs_path() {
|
||||||
# exploits the fact that pwd will print abs path when no args
|
# exploits the fact that pwd will print abs path when no args
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Azure.Storage.Blobs" Version="12.25.1" />
|
<PackageReference Include="Azure.Storage.Blobs" Version="12.25.0" />
|
||||||
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
|
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="6.0.0" />
|
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="6.0.0" />
|
||||||
|
|||||||
Reference in New Issue
Block a user