Skip to content

fix: retry GitHub webhook delivery on 401 or missing secret #32

fix: retry GitHub webhook delivery on 401 or missing secret

fix: retry GitHub webhook delivery on 401 or missing secret #32

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Check formatting
run: cargo fmt --all -- --check
- name: Run clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Run unit tests
run: cargo test --all-features --bin n8n-slack-unihook
- name: Build release
run: cargo build --release
integration-tests:
name: Integration Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Run integration tests
run: ./scripts/run-integration-tests.sh
# Check if version changed (for release workflow trigger)
version-check:
name: Check Version
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
outputs:
version: ${{ steps.version.outputs.version }}
version_changed: ${{ steps.check.outputs.changed }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get version from Cargo.toml
id: version
run: |
VERSION=$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/')
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Current version: $VERSION"
- name: Check if tag exists
id: check
run: |
VERSION="${{ steps.version.outputs.version }}"
if git rev-parse "v$VERSION" >/dev/null 2>&1; then
echo "Tag v$VERSION already exists"
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "Tag v$VERSION does not exist - will create release"
echo "changed=true" >> $GITHUB_OUTPUT
fi
# Trigger release if version changed
trigger-release:
name: Trigger Release
needs: [check, integration-tests, version-check]
if: needs.version-check.outputs.version_changed == 'true'
uses: ./.github/workflows/release.yml
with:
version: ${{ needs.version-check.outputs.version }}
secrets: inherit