-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into 28337-binary-field-information-of-assets-n…
…eeds-be-refreshed-after-any-change
- Loading branch information
Showing
8 changed files
with
112 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Generate SBOM for latest version of dotCMS and put into core-test-repo | ||
on: | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
inputs: | ||
dotcms_version: | ||
description: 'Enter the dotCMS version (vYY.MM.DD)' | ||
required: true | ||
default: '' | ||
|
||
jobs: | ||
scan: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write # Ensure write access to contents | ||
|
||
steps: | ||
- name: Checkout core-test-results repository | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: dotCMS/core-test-results | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
path: core-test-results | ||
|
||
- name: Get dotCMS release version | ||
id: get_version | ||
run: | | ||
if [ "${{ github.event_name }}" == "release" ]; then | ||
# Extract the tag name from the release event context | ||
latest_tag=${{ github.event.release.tag_name }} | ||
else | ||
# Use the input provided in manual run | ||
latest_tag=${{ github.event.inputs.dotcms_version }} | ||
fi | ||
# Format the tag name if necessary | ||
formatted_tag=$(echo "$latest_tag" | sed -e 's/^dotcms-cli-//' -e 's/^v//') | ||
echo "Latest tag: $formatted_tag" | ||
echo "DOTCMS_VERSION=$formatted_tag" >> $GITHUB_ENV | ||
- name: Pull and run dotCMS Docker image | ||
run: | | ||
docker pull dotcms/dotcms:${{ env.DOTCMS_VERSION }} | ||
docker run -d -p 8082:8082 dotcms/dotcms:${{ env.DOTCMS_VERSION }} | ||
- name: Install pipx | ||
run: | | ||
pip install pipx | ||
- name: Scan Docker Image with Syft | ||
run: | | ||
pipx run anchore_syft dotcms/dotcms:${{ env.DOTCMS_VERSION }} -o cyclonedx-xml > core-test-results/sbom/cyclonedx.json | ||
- name: Rename SBOM file with dotCMS version | ||
run: | | ||
mkdir -p core-test-results/sbom | ||
mv core-test-results/sbom/cyclonedx.json core-test-results/sbom/dotcms-${{ env.DOTCMS_VERSION }}.json | ||
- name: Configure Git | ||
run: | | ||
git config --global user.email "action@github.com" | ||
git config --global user.name "Github Actions" | ||
- name: Commit and push results to core-test-results repository | ||
run: | | ||
cd core-test-results | ||
git add sbom/dotcms-${{ env.DOTCMS_VERSION }}.json | ||
git commit -m "Add SBOM for dotCMS version ${{ env.DOTCMS_VERSION }}" || echo "No changes to commit" | ||
git push origin master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters