Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
walkowif committed Feb 29, 2024
1 parent 6ff3db5 commit ef7f841
Showing 1 changed file with 36 additions and 24 deletions.
60 changes: 36 additions & 24 deletions .github/workflows/spelling.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,40 +36,42 @@ concurrency:
cancel-in-progress: true

jobs:
check-skip-instructions:
name: Check skip instructions ⚙️
runs-on: ubuntu-latest
outputs:
head-commit-message: ${{ steps.get-commit-message.outputs.head_commit_message }}
steps:
- name: Checkout Code 🛎
uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ github.event.pull_request.head.sha }}
# check-skip-instructions:
# name: Check skip instructions ⚙️
# runs-on: ubuntu-latest
# outputs:
# head-commit-message: ${{ steps.get-commit-message.outputs.head_commit_message }}
# steps:
# - name: Checkout Code 🛎
# uses: actions/checkout@v4
# with:
# fetch-depth: 1
# ref: ${{ github.event.pull_request.head.sha }}

- name: Get commit message 💬
id: get-commit-message
run: |
echo "head_commit_message=$(git show -s --format=%B | tr '\r\n' ' ' | tr '\n' ' ')" >> $GITHUB_OUTPUT
echo "head_commit_message = $(git show -s --format=%B | tr '\r\n' ' ' | tr '\n' ' ')"
shell: bash
# - name: Get commit message 💬
# id: get-commit-message
# run: |
# echo "head_commit_message=$(git show -s --format=%B | tr '\r\n' ' ' | tr '\n' ' ')" >> $GITHUB_OUTPUT
# echo "head_commit_message = $(git show -s --format=%B | tr '\r\n' ' ' | tr '\n' ' ')"
# shell: bash

spelling:
name: Check spelling 🔠
runs-on: ubuntu-latest
needs: check-skip-instructions
# needs: check-skip-instructions
if: >
!contains(needs.check-skip-instructions.outputs.head-commit-message, '[skip spelling]')
&& github.event.pull_request.draft == false
github.event.pull_request.draft == false
# if: >
# !contains(needs.check-skip-instructions.outputs.head-commit-message, '[skip spelling]')
# && github.event.pull_request.draft == false
container:
image: ghcr.io/insightsengineering/rstudio:latest

steps:
- name: Debug
run: |
echo "skip_spelling = ${{ contains(needs.check-skip-instructions.outputs.head-commit-message, '[skip spelling]') }}"
echo "head_commit_message = ${{ needs.check-skip-instructions.outputs.head-commit-message }}"
# - name: Debug
# run: |
# echo "skip_spelling = ${{ contains(needs.check-skip-instructions.outputs.head-commit-message, '[skip spelling]') }}"
# echo "head_commit_message = ${{ needs.check-skip-instructions.outputs.head-commit-message }}"

- name: Setup token 🔑
id: github-token
Expand All @@ -88,6 +90,16 @@ jobs:
with:
token: ${{ steps.github-token.outputs.token }}

- name: Get commit message 💬
run: |
export head_commit_message="$(git show -s --format=%B | tr '\r\n' ' ' | tr '\n' ' ')"
echo "head_commit_message = $(git show -s --format=%B | tr '\r\n' ' ' | tr '\n' ' ')"
if [[ $head_commit_message == *"[skip spelling]"* ]]; then
echo "Skip instruction detected."
exit 0
fi
shell: bash

- name: Normalize variables 📏
run: |
package_subdirectory_input="${{ inputs.package-subdirectory }}"
Expand Down

0 comments on commit ef7f841

Please sign in to comment.