Merge branch 'main' into main
This commit is contained in:
@@ -24,7 +24,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
# Run Synthetic tests within your GitHub workflow.
|
||||
# For additional configuration options visit the action within the marketplace: https://github.com/marketplace/actions/datadog-synthetics-ci
|
||||
|
||||
@@ -109,7 +109,7 @@ jobs:
|
||||
|
||||
# Upload the MSIX package: https://github.com/marketplace/actions/upload-a-build-artifact
|
||||
- name: Upload build artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: MSIX Package
|
||||
path: ${{ env.Wap_Project_Directory }}\AppPackages
|
||||
|
||||
@@ -31,7 +31,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
|
||||
@@ -29,7 +29,7 @@ jobs:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
- name: Bandit Scan
|
||||
uses: shundor/python-bandit-scan@9cc5aa4a006482b8a7f91134412df6772dbda22c
|
||||
with: # optional arguments
|
||||
|
||||
@@ -27,7 +27,7 @@ jobs:
|
||||
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Scan code
|
||||
uses: clj-holmes/clj-holmes-action@200d2d03900917d7eb3c24fc691ab83579a87fcb
|
||||
|
||||
@@ -32,7 +32,7 @@ jobs:
|
||||
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Dependency scan
|
||||
uses: clj-holmes/clj-watson-action@39b8ed306f2c125860cf6e69b6939363689f998c
|
||||
|
||||
@@ -77,11 +77,11 @@ jobs:
|
||||
contents: read # for actions/checkout to fetch code
|
||||
security-events: write # for redhat-actions/crda to upload SARIF results
|
||||
name: Scan project vulnerabilities with CRDA
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# *******************************************************************
|
||||
# Required: Instructions to setup project
|
||||
|
||||
@@ -16,7 +16,7 @@ on:
|
||||
jobs:
|
||||
lint:
|
||||
name: DevSkim
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
|
||||
@@ -17,7 +17,7 @@ on:
|
||||
jobs:
|
||||
lint:
|
||||
name: Kubesec
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
|
||||
@@ -60,7 +60,7 @@ jobs:
|
||||
|
||||
# Upload SARIF file as an Artifact to download and view
|
||||
# - name: Upload SARIF as an Artifact
|
||||
# uses: actions/upload-artifact@v3
|
||||
# uses: actions/upload-artifact@v4
|
||||
# with:
|
||||
# name: sarif-file
|
||||
# path: ${{ steps.run-analysis.outputs.sarif }}
|
||||
|
||||
@@ -162,7 +162,7 @@ jobs:
|
||||
runs-on: ubuntu-18.04
|
||||
name: A job to run a Nexploit scan
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
- name: Start Nexploit Scan 🏁
|
||||
id: start
|
||||
uses: NeuraLegion/run-scan@29ebd17b4fd6292ce7a238a59401668953b37fbe
|
||||
|
||||
@@ -36,15 +36,25 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Run SOOS DAST Analysis
|
||||
uses: soos-io/soos-dast-github-action@65d9878d77c8993f3db9e86a92bc2ad3a6e060af
|
||||
uses: soos-io/soos-dast-github-action@a7eb40b94c1c81eb76b178ba1befdc21823f86fa
|
||||
with:
|
||||
client_id: ${{ secrets.SOOS_CLIENT_ID }}
|
||||
api_key: ${{ secrets.SOOS_API_KEY }}
|
||||
project_name: "<YOUR-PROJECT-NAME>"
|
||||
scan_mode: "baseline"
|
||||
target_url: "https://www.example.com/"
|
||||
output_format: "sarif"
|
||||
export_format: "Sarif"
|
||||
export_file_type: "Json"
|
||||
- name: Find and rename SARIF file since it is unique
|
||||
run: |
|
||||
file=$(find . -name "*.sarif.json" | head -n 1)
|
||||
if [ -n "$file" ]; then
|
||||
mv "$file" output.sarif.json
|
||||
echo "Renamed $file to output.sarif.json"
|
||||
else
|
||||
echo "No SARIF file found" && exit 1
|
||||
fi
|
||||
- name: Upload SOOS DAST SARIF Report
|
||||
uses: github/codeql-action/upload-sarif@v3
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
sarif_file: output.sarif.json
|
||||
|
||||
@@ -46,7 +46,7 @@ jobs:
|
||||
contents: read # for actions/checkout to fetch code
|
||||
security-events: write # for stackhawk/hawkscan-action to upload code scanning alert info
|
||||
name: StackHawk
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
@@ -24,7 +24,7 @@ jobs:
|
||||
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
|
||||
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
|
||||
name: Build
|
||||
runs-on: "ubuntu-20.04"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
@@ -87,7 +87,7 @@ jobs:
|
||||
license: ${{ secrets.XANITIZER_LICENSE }}
|
||||
|
||||
# Archiving the findings list reports
|
||||
- uses: actions/upload-artifact@v3
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Xanitizer-Reports
|
||||
path: |
|
||||
|
||||
@@ -59,7 +59,7 @@ jobs:
|
||||
run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp
|
||||
|
||||
- name: Upload artifact for deployment job
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: .net-app
|
||||
path: ${{env.DOTNET_ROOT}}/myapp
|
||||
@@ -75,7 +75,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Download artifact from build job
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: .net-app
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ jobs:
|
||||
run: gradle build
|
||||
|
||||
- name: Upload artifact for deployment job
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: java-app
|
||||
path: '${{ github.workspace }}/build/libs/*.jar'
|
||||
@@ -66,7 +66,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Download artifact from build job
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: java-app
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ jobs:
|
||||
run: mvn clean install
|
||||
|
||||
- name: Upload artifact for deployment job
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: java-app
|
||||
path: '${{ github.workspace }}/target/*.jar'
|
||||
@@ -66,7 +66,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Download artifact from build job
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: java-app
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ jobs:
|
||||
npm run test --if-present
|
||||
|
||||
- name: Upload artifact for deployment job
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: node-app
|
||||
path: .
|
||||
@@ -65,7 +65,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Download artifact from build job
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: node-app
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ jobs:
|
||||
run: composer validate --no-check-publish && composer install --prefer-dist --no-progress
|
||||
|
||||
- name: Upload artifact for deployment job
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: php-app
|
||||
path: .
|
||||
@@ -86,7 +86,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Download artifact from build job
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: php-app
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ jobs:
|
||||
# Optional: Add step to run tests here (PyTest, Django test suites, etc.)
|
||||
|
||||
- name: Upload artifact for deployment jobs
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: python-app
|
||||
path: |
|
||||
@@ -73,7 +73,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Download artifact from build job
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: python-app
|
||||
path: .
|
||||
|
||||
+112
-112
@@ -1,112 +1,112 @@
|
||||
# This workflow uses actions that are not certified by GitHub.
|
||||
# They are provided by a third-party and are governed by separate terms of service,
|
||||
# privacy policy, and support documentation.
|
||||
#
|
||||
# This workflow will build and publish a Docker container which is then deployed through Octopus Deploy.
|
||||
#
|
||||
# The build job in this workflow currently assumes that there is a Dockerfile that generates the relevant application image.
|
||||
# If required, this job can be modified to generate whatever alternative build artifact is required for your deployment.
|
||||
#
|
||||
# This workflow assumes you have already created a Project in Octopus Deploy.
|
||||
# For instructions see https://octopus.com/docs/projects/setting-up-projects
|
||||
#
|
||||
# To configure this workflow:
|
||||
#
|
||||
# 1. Decide where you are going to host your image.
|
||||
# This template uses the GitHub Registry for simplicity but if required you can update the relevant DOCKER_REGISTRY variables below.
|
||||
#
|
||||
# 2. Create and configure an OIDC credential for a service account in Octopus.
|
||||
# This allows for passwordless authentication to your Octopus instance through a trust relationship configured between Octopus, GitHub and your GitHub Repository.
|
||||
# https://octopus.com/docs/octopus-rest-api/openid-connect/github-actions
|
||||
#
|
||||
# 3. Configure your Octopus project details below:
|
||||
# OCTOPUS_URL: update to your Octopus Instance Url
|
||||
# OCTOPUS_SERVICE_ACCOUNT: update to your service account Id
|
||||
# OCTOPUS_SPACE: update to the name of the space your project is configured in
|
||||
# OCTOPUS_PROJECT: update to the name of your Octopus project
|
||||
# OCTOPUS_ENVIRONMENT: update to the name of the environment to recieve the first deployment
|
||||
|
||||
|
||||
name: 'Build and Deploy to Octopus Deploy'
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '$default-branch'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
packages: write
|
||||
contents: read
|
||||
env:
|
||||
DOCKER_REGISTRY: ghcr.io # TODO: Update to your docker registry uri
|
||||
DOCKER_REGISTRY_USERNAME: ${{ github.actor }} # TODO: Update to your docker registry username
|
||||
DOCKER_REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }} # TODO: Update to your docker registry password
|
||||
outputs:
|
||||
image_tag: ${{ steps.meta.outputs.version }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
|
||||
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
|
||||
with:
|
||||
registry: ${{ env.DOCKER_REGISTRY }}
|
||||
username: ${{ env.DOCKER_REGISTRY_USERNAME }}
|
||||
password: ${{ env.DOCKER_REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
|
||||
with:
|
||||
images: ${{ env.DOCKER_REGISTRY }}/${{ github.repository }}
|
||||
tags: type=semver,pattern={{version}},value=v1.0.0-{{sha}}
|
||||
|
||||
- name: Build and push Docker image
|
||||
id: push
|
||||
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
deploy:
|
||||
name: Deploy
|
||||
permissions:
|
||||
id-token: write
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ build ]
|
||||
env:
|
||||
OCTOPUS_URL: 'https://your-octopus-url' # TODO: update to your Octopus Instance url
|
||||
OCTOPUS_SERVICE_ACCOUNT: 'your-service-account-id' # TODO: update to your service account Id
|
||||
OCTOPUS_SPACE: 'your-space' # TODO: update to the name of the space your project is configured in
|
||||
OCTOPUS_PROJECT: 'your-project' # TODO: update to the name of your Octopus project
|
||||
OCTOPUS_ENVIRONMENT: 'your-environment' # TODO: update to the name of the environment to recieve the first deployment
|
||||
|
||||
steps:
|
||||
- name: Login to Octopus Deploy
|
||||
uses: OctopusDeploy/login@34b6dcc1e86fa373c14e6a28c5507d221e4de629 #v1.0.2
|
||||
with:
|
||||
server: '${{ env.OCTOPUS_URL }}'
|
||||
service_account_id: '${{ env.OCTOPUS_SERVICE_ACCOUNT }}'
|
||||
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: OctopusDeploy/create-release-action@fea7e7b45c38c021b6bc5a14bd7eaa2ed5269214 #v3.2.2
|
||||
with:
|
||||
project: '${{ env.OCTOPUS_PROJECT }}'
|
||||
space: '${{ env.OCTOPUS_SPACE }}'
|
||||
packages: '*:${{ needs.build.outputs.image_tag }}'
|
||||
|
||||
- name: Deploy Release
|
||||
uses: OctopusDeploy/deploy-release-action@b10a606c903b0a5bce24102af9d066638ab429ac #v3.2.1
|
||||
with:
|
||||
project: '${{ env.OCTOPUS_PROJECT }}'
|
||||
space: '${{ env.OCTOPUS_SPACE }}'
|
||||
release_number: '${{ steps.create_release.outputs.release_number }}'
|
||||
environments: ${{ env.OCTOPUS_ENVIRONMENT }}
|
||||
# This workflow uses actions that are not certified by GitHub.
|
||||
# They are provided by a third-party and are governed by separate terms of service,
|
||||
# privacy policy, and support documentation.
|
||||
#
|
||||
# This workflow will build and publish a Docker container which is then deployed through Octopus Deploy.
|
||||
#
|
||||
# The build job in this workflow currently assumes that there is a Dockerfile that generates the relevant application image.
|
||||
# If required, this job can be modified to generate whatever alternative build artifact is required for your deployment.
|
||||
#
|
||||
# This workflow assumes you have already created a Project in Octopus Deploy.
|
||||
# For instructions see https://octopus.com/docs/projects/setting-up-projects
|
||||
#
|
||||
# To configure this workflow:
|
||||
#
|
||||
# 1. Decide where you are going to host your image.
|
||||
# This template uses the GitHub Registry for simplicity but if required you can update the relevant DOCKER_REGISTRY variables below.
|
||||
#
|
||||
# 2. Create and configure an OIDC credential for a service account in Octopus.
|
||||
# This allows for passwordless authentication to your Octopus instance through a trust relationship configured between Octopus, GitHub and your GitHub Repository.
|
||||
# https://octopus.com/docs/octopus-rest-api/openid-connect/github-actions
|
||||
#
|
||||
# 3. Configure your Octopus project details below:
|
||||
# OCTOPUS_URL: update to your Octopus Instance Url
|
||||
# OCTOPUS_SERVICE_ACCOUNT: update to your service account Id
|
||||
# OCTOPUS_SPACE: update to the name of the space your project is configured in
|
||||
# OCTOPUS_PROJECT: update to the name of your Octopus project
|
||||
# OCTOPUS_ENVIRONMENT: update to the name of the environment to recieve the first deployment
|
||||
|
||||
|
||||
name: 'Build and Deploy to Octopus Deploy'
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '$default-branch'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
packages: write
|
||||
contents: read
|
||||
env:
|
||||
DOCKER_REGISTRY: ghcr.io # TODO: Update to your docker registry uri
|
||||
DOCKER_REGISTRY_USERNAME: ${{ github.actor }} # TODO: Update to your docker registry username
|
||||
DOCKER_REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }} # TODO: Update to your docker registry password
|
||||
outputs:
|
||||
image_tag: ${{ steps.meta.outputs.version }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
|
||||
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
|
||||
with:
|
||||
registry: ${{ env.DOCKER_REGISTRY }}
|
||||
username: ${{ env.DOCKER_REGISTRY_USERNAME }}
|
||||
password: ${{ env.DOCKER_REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
|
||||
with:
|
||||
images: ${{ env.DOCKER_REGISTRY }}/${{ github.repository }}
|
||||
tags: type=semver,pattern={{version}},value=v1.0.0-{{sha}}
|
||||
|
||||
- name: Build and push Docker image
|
||||
id: push
|
||||
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
deploy:
|
||||
name: Deploy
|
||||
permissions:
|
||||
id-token: write
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ build ]
|
||||
env:
|
||||
OCTOPUS_URL: 'https://your-octopus-url' # TODO: update to your Octopus Instance url
|
||||
OCTOPUS_SERVICE_ACCOUNT: 'your-service-account-id' # TODO: update to your service account Id
|
||||
OCTOPUS_SPACE: 'your-space' # TODO: update to the name of the space your project is configured in
|
||||
OCTOPUS_PROJECT: 'your-project' # TODO: update to the name of your Octopus project
|
||||
OCTOPUS_ENVIRONMENT: 'your-environment' # TODO: update to the name of the environment to recieve the first deployment
|
||||
|
||||
steps:
|
||||
- name: Log in to Octopus Deploy
|
||||
uses: OctopusDeploy/login@34b6dcc1e86fa373c14e6a28c5507d221e4de629 #v1.0.2
|
||||
with:
|
||||
server: '${{ env.OCTOPUS_URL }}'
|
||||
service_account_id: '${{ env.OCTOPUS_SERVICE_ACCOUNT }}'
|
||||
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: OctopusDeploy/create-release-action@fea7e7b45c38c021b6bc5a14bd7eaa2ed5269214 #v3.2.2
|
||||
with:
|
||||
project: '${{ env.OCTOPUS_PROJECT }}'
|
||||
space: '${{ env.OCTOPUS_SPACE }}'
|
||||
packages: '*:${{ needs.build.outputs.image_tag }}'
|
||||
|
||||
- name: Deploy Release
|
||||
uses: OctopusDeploy/deploy-release-action@b10a606c903b0a5bce24102af9d066638ab429ac #v3.2.1
|
||||
with:
|
||||
project: '${{ env.OCTOPUS_PROJECT }}'
|
||||
space: '${{ env.OCTOPUS_SPACE }}'
|
||||
release_number: '${{ steps.create_release.outputs.release_number }}'
|
||||
environments: ${{ env.OCTOPUS_ENVIRONMENT }}
|
||||
|
||||
@@ -77,7 +77,7 @@ jobs:
|
||||
# 🖊️ Uncomment this if you are using CRDA scan step above
|
||||
# needs: crda-scan
|
||||
name: Build and deploy to OpenShift
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
environment: production
|
||||
|
||||
outputs:
|
||||
|
||||
+2
-1
@@ -34,7 +34,8 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Ruby
|
||||
uses: ruby/setup-ruby@8575951200e472d5f2d95c625da0c7bec8217c42 # v1.161.0
|
||||
# https://github.com/ruby/setup-ruby/releases/tag/v1.207.0
|
||||
uses: ruby/setup-ruby@4a9ddd6f338a97768b8006bf671dfbad383215f4
|
||||
with:
|
||||
ruby-version: '3.1' # Not needed with a .ruby-version file
|
||||
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
||||
|
||||
@@ -196,6 +196,27 @@ async function checkWorkflow(
|
||||
})
|
||||
),
|
||||
]);
|
||||
|
||||
// The v4 versions of upload and download artifact are not yet supported on GHES
|
||||
console.group("Updating all compatible workflows to use v3 of the artifact actions");
|
||||
for (const workflow of result.compatibleWorkflows) {
|
||||
const path = join(workflow.folder, `${workflow.id}.yml`);
|
||||
console.log(`Updating ${path}`);
|
||||
const contents = await fs.readFile(path, "utf8");
|
||||
|
||||
if (contents.includes("actions/upload-artifact@v4") || contents.includes("actions/download-artifact@v4")) {
|
||||
console.log("Found v4 artifact actions, updating to v3");
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
||||
let updatedContents = contents.replace(/actions\/upload-artifact@v4/g, "actions/upload-artifact@v3");
|
||||
updatedContents = updatedContents.replace(/actions\/download-artifact@v4/g, "actions/download-artifact@v3");
|
||||
|
||||
await fs.writeFile(path, updatedContents);
|
||||
}
|
||||
console.groupEnd();
|
||||
|
||||
} catch (e) {
|
||||
console.error("Unhandled error while syncing workflows", e);
|
||||
process.exitCode = 1;
|
||||
|
||||
Reference in New Issue
Block a user