Skip to content

[ci] enforce 'zizmor' checks in CI #426

[ci] enforce 'zizmor' checks in CI

[ci] enforce 'zizmor' checks in CI #426

Workflow file for this run

# builds core artifacts, intended to be attached to releases
# or used by other workflows
name: Build
on:
push:
branches:
- master
pull_request:
branches:
- master
# automatically cancel in-progress builds if another commit is pushed
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# default to 0 permissions
# (job-level overrides add the minimal permissions needed)
permissions:
contents: none
env:
# tell scripts where to put artifacts
BUILD_ARTIFACTSTAGINGDIRECTORY: '${{ github.workspace }}/artifacts'
jobs:
archive:
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 5
persist-credentials: false
submodules: true
- name: Create source archive
run: |
mkdir -p "${BUILD_ARTIFACTSTAGINGDIRECTORY}"
tar \
-czvf \
/tmp/LightGBM-complete_source_code_tar_gz.tar.gz \
.
mv \
/tmp/LightGBM-complete_source_code_tar_gz.tar.gz \
${BUILD_ARTIFACTSTAGINGDIRECTORY}/
- name: Create commit.txt
shell: bash
run: |
# for pull requests, github.sha refers to the merge commit from merging the PR and
# target branch... we want the actual commit that was pushed
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
COMMIT_SHA="${{ github.event.pull_request.head.sha }}"
else
COMMIT_SHA="${{ github.sha }}"
fi
echo "${COMMIT_SHA}" > "${BUILD_ARTIFACTSTAGINGDIRECTORY}/commit.txt"
- name: Upload artifacts
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: source-archive
path: |
${{ env.BUILD_ARTIFACTSTAGINGDIRECTORY }}/commit.txt
${{ env.BUILD_ARTIFACTSTAGINGDIRECTORY }}/LightGBM-complete_source_code_tar_gz.tar.gz
if-no-files-found: error
all-build-jobs-successful:
if: always()
runs-on: ubuntu-latest
needs:
- archive
permissions:
statuses: read
steps:
- name: Note that all tests succeeded
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
with:
jobs: ${{ toJSON(needs) }}