Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency com.powsybl:powsybl-parent to v20 - abandoned #12

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .github/nad-sld-diagrams.jpg
Binary file not shown.
42 changes: 0 additions & 42 deletions .github/workflows/maven.yml

This file was deleted.

89 changes: 89 additions & 0 deletions .github/workflows/sync-fork.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Sync fork

on:
workflow_dispatch: {}
schedule:
- cron: "15 3 * * *" # Run every day at 3:15 UTC

jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout fork's default branch
uses: actions/checkout@v4
with:
fetch-depth: 0
path: "fork"
token: ${{ secrets.GH_PAT }}
- name: Checkout fork's configuration branch
uses: actions/checkout@v4
with:
path: "configuration"
ref: "renovate-and-workflow-files"
token: ${{ secrets.GH_PAT }}
- name: Determine Upstream clone URL
id: upstream-repo-clone-url
uses: actions/github-script@v7
with:
script: |
const { data } = await github.rest.repos.get({
owner: context.repo.owner,
repo: context.repo.repo,
});
if (data.fork) {
return data.parent.clone_url;
} else {
throw new Error('This repository is not a fork.');
}
result-encoding: string
- name: Determine Upstream default branch
id: upstream-repo-default-branch
uses: actions/github-script@v7
with:
script: |
const { data } = await github.rest.repos.get({
owner: context.repo.owner,
repo: context.repo.repo,
});
if (data.fork) {
return data.parent.default_branch;
} else {
throw new Error('This repository is not a fork.');
}
result-encoding: string
- name: Sync fork with upstream
run: |
set -ex
cd fork
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git remote add upstream ${{ steps.upstream-repo-clone-url.outputs.result }}
git fetch upstream ${{ steps.upstream-repo-default-branch.outputs.result }}
UPSTREAM_MOST_RECENT_COMMIT_HASH=$(git log upstream/${{ steps.upstream-repo-default-branch.outputs.result }} -n 1 --format="%H")
PREVIOUS_SYNC_COMMIT_HASH=$(cat ../configuration/upstream_commit_hash)
if [ "$PREVIOUS_SYNC_COMMIT_HASH" = "$UPSTREAM_MOST_RECENT_COMMIT_HASH" ]; then
echo "No need to sync, already up-to-date"
exit 0
fi
git reset --hard upstream/${{ steps.upstream-repo-default-branch.outputs.result }}
# Enforce the usage of our own config (renovate.json5)
git rm renovate.json* || true
# Avoid problems where an existing .gitignore file would prevent committing our configuration files
git rm .gitignore || true
# Delete existing workflows, we don't need to run them in our fork
rm -rf .github || true
# Instead of using "cp -r", rsync allows us to exclude the .git directory
rsync -av --exclude '.git' ../configuration/ .
rm upstream_commit_hash
git add .
git commit -m "add Renovate and custom workflow files"
git push --force-with-lease
cd ../configuration
# git config user.name "github-actions[bot]"
# git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
echo $UPSTREAM_MOST_RECENT_COMMIT_HASH > upstream_commit_hash
git add upstream_commit_hash
git commit -m "update commit hash to $UPSTREAM_MOST_RECENT_COMMIT_HASH"
git push
27 changes: 27 additions & 0 deletions .github/workflows/trivy-dependencies-submission.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: SBOM upload from Trivy

on:
workflow_dispatch: {}
schedule:
- cron: "0 9 */5 * *" # Run every fifth day at 9 AM UTC

jobs:
SBOM-upload:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/[email protected]
with:
scan-type: 'fs'
ignore-unfixed: true
format: 'github'
output: 'trivy-results.gsbom'
github-pat: ${{ secrets.GITHUB_TOKEN }} # this causes a curl call to upload the snapshot

- name: Upload report file
uses: actions/upload-artifact@v4
with:
name: trivy-results
path: trivy-results.gsbom
22 changes: 0 additions & 22 deletions .gitignore

This file was deleted.

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<parent>
<groupId>com.powsybl</groupId>
<artifactId>powsybl-parent</artifactId>
<version>15</version>
<version>20</version>
<relativePath/>
</parent>
<artifactId>powsybl-diagram</artifactId>
Expand Down
12 changes: 12 additions & 0 deletions renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended",
":disableRateLimiting"
],
"labels": ["dependencies", "depManager:{{{manager}}}"],
"vulnerabilityAlerts": {
"labels": ["security", "dependencies", "depManager:{{{manager}}}"],
},
"forkProcessing": "enabled"
}