From ec4df9dcc93834b5f6ec474a092c07bd4352526a Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Fri, 16 Feb 2024 08:42:42 +0100 Subject: [PATCH 1/2] cleanup: improvements to the composite action + document it. Signed-off-by: Federico Di Pierro --- .github/workflows/ci.yml | 3 +-- .github/workflows/test.yml | 2 +- README.md | 15 +++++++++++++++ action.yml | 24 +++++++++++------------- 4 files changed, 28 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index efb9c51..6927621 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,9 +15,8 @@ jobs: name: build syscalls-bumper runs-on: ubuntu-latest steps: - - 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..a0c6df3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - + - 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..56e09a6 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@v4 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 From 6788cb0adcfbd7c92c3b8f79360e1d777ab5d1dd Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Fri, 16 Feb 2024 08:48:28 +0100 Subject: [PATCH 2/2] chore(ci): bump checkout and setup-go actions. Moreover, use `go-version-file` directive in setup-go action. Signed-off-by: Federico Di Pierro --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index afdd464..baffe61 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -32,9 +32,9 @@ jobs: uses: docker/setup-buildx-action@v2 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: - go-version: 1.19 + go-version-file: 'go.mod' - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2