Skip to content

Commit

Permalink
ORT workflows rework:
Browse files Browse the repository at this point in the history
1. Added ort-sweeper workflow that triggers periodic (once a day) ORT runs for branches main and release-*
2. Fixed ORT invocation for glide-core/redis-rs by creating a virtual workspace
3. Updated license-generating script to prevent the creation of unapproved_package_list.txt file for unapproved/unknown licenses
4. Configured ORT checker workflow to run on each pull request without file filters, producing warnings if licenses need to be updated
5. TODO: Modify ORT checker to fail pull requests introducing unapproved/unknown licenses, deferred until unsupported licenses are removed to avoid blocking PRs
6. Added support to trigger the ORT checker manually with a specified target branch

Signed-off-by: ikolomi <[email protected]>
  • Loading branch information
ikolomi committed Nov 18, 2024
1 parent ddd98cc commit b8dc6a5
Show file tree
Hide file tree
Showing 5 changed files with 299 additions and 205 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/ort-sweeper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: ORT - Trigger periodic checks for relevant branches

on:
schedule:
- cron: '0 0 * * *' # Runs daily at 00:00 UTC

jobs:
trigger-ort-check:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Fetch relevant branches
id: get-branches
run: |
# Get all branches matching 'release-*' and include 'main'
branches=$(git ls-remote --heads origin | awk -F'/' '/refs\/heads\/release-/ {print $NF}')
branches="main $branches"
echo "::set-output name=branches::$branches"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Trigger ORT Check workflows
uses: actions/github-script@v6
with:
script: |
const branches = "${{ steps.get-branches.outputs.branches }}".split(" ");
const workflowFile = "ort.yml";
const triggerWorkflow = async (branch) => {
try {
console.log(`Triggering workflow for branch: ${branch}`);
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: workflowFile,
ref: branch, // The branch where workflow_dispatch is triggered
inputs: {
branch_name: branch
}
});
console.log(`Successfully triggered workflow for branch: ${branch}`);
} catch (error) {
core.setFailed(error.message);
}
};
// Fire all workflow dispatch requests concurrently
const promises = branches
.filter(branch => branch) // Skip empty branches
.map(branch => triggerWorkflow(branch));
await Promise.allSettled(promises);
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit b8dc6a5

Please sign in to comment.