From 1e3469542ff9e40540004070b6b84e726ed07271 Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Fri, 16 Feb 2024 08:42:42 +0100 Subject: [PATCH] cleanup: improvements to the composite action + document it. Signed-off-by: Federico Di Pierro --- .github/workflows/ci.yml | 6 ++++-- .github/workflows/test.yml | 5 +---- README.md | 15 +++++++++++++++ action.yml | 24 +++++++++++------------- 4 files changed, 31 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index efb9c51..c869f29 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,9 +15,11 @@ jobs: name: build syscalls-bumper runs-on: ubuntu-latest steps: - + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout libs ⤵️ - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: falcosecurity/libs path: ${{ github.workspace }}/libs diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6fc728b..a3f3470 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,10 +8,7 @@ on: jobs: test-composite-action: runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - + steps: - name: Checkout uses: actions/checkout@v4 with: diff --git a/README.md b/README.md index df04d02..82e251a 100644 --- a/README.md +++ b/README.md @@ -24,3 +24,18 @@ syscalls-bumper -h -verbose enable verbose logging ``` + +## CI Usage + +To better suit the CI usage, a [Github composite action](https://docs.github.com/en/actions/creating-actions/creating-a-composite-action) has been developed. +Therefore, running syscalls-bumper in your Github workflow is as easy as adding this step: +``` +- name: Bump syscalls + uses: falcosecurity/syscalls-bumper@main + with: + # Path to the libs repo. + # No default. Mandatory. + repo-root: 'true' +``` + +> __NOTE:__ Since we don't use annotated tags, one cannot use eg: falcosecurity/syscalls-bumper@v0, but only either exact tag name, branch name or commit hash. diff --git a/action.yml b/action.yml index f57a0cf..9fb497d 100644 --- a/action.yml +++ b/action.yml @@ -9,21 +9,19 @@ inputs: runs: using: "composite" steps: - - uses: robinraju/release-downloader@v1.8 + - name: Setup Go + uses: actions/setup-go@v3 with: - fileName: syscalls-bumper_*_linux_amd64.tar.gz - tarBall: false - zipBall: false - extract: true - latest: true - repository: "falcosecurity/syscalls-bumper" - - - name: Bump syscalls + go-version-file: "${{ github.action_path }}/go.mod" + + - name: Build tool shell: bash + working-directory: ${{ github.action_path }} run: | - ./syscalls-bumper --repo-root ${{ inputs.repo-root }} --overwrite - - - name: Cleanup + make build + + - name: Bump syscalls shell: bash + working-directory: ${{ github.action_path }} run: | - rm -rf syscalls-bumper* + ./build/syscalls-bumper --repo-root ${{ inputs.repo-root }} --overwrite