mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
AAE-12589 - fixing ci:force flag (#8338)
* AAE-12589 fixing ci:force flag * [ci:force] * check ci:force var * check ci:force var * [ci:force] * [ci:force] * [ci:force] * ci force fix * ci force fix * [ci:force] * [ci:force] * [ci:force] * [ci:force] * [ci:force] * [ci:force] * [ci:force] * [ci:force] * [ci:force] * [ci:force] * [ci:force]
This commit is contained in:
19
.github/actions/before-install/action.yml
vendored
19
.github/actions/before-install/action.yml
vendored
@@ -31,18 +31,15 @@ runs:
|
||||
|
||||
- name: affected:* flag parser
|
||||
shell: bash
|
||||
if: ${{ contains(github.event.head_commit.message , '[affected:*]') }}
|
||||
run: |
|
||||
echo "Setting up CI to run with commit flag [affected:*] flag."
|
||||
echo "BREAK_ACTION=true" >> $GITHUB_ENV
|
||||
|
||||
- name: ci:force flag parser
|
||||
shell: bash
|
||||
if: ${{ contains(github.event.head_commit.message , '[ci:force]') }}
|
||||
run: |
|
||||
echo "Forcing CI to run with commit flag [ci:force]."
|
||||
echo CI_FORCE_RUN=true >> $GITHUB_ENV
|
||||
echo "BREAK_ACTION=true" >> $GITHUB_ENV
|
||||
git fetch --all
|
||||
message=$(git log --format=%B -n 1 origin/${{ github.head_ref }})
|
||||
echo "COMMIT_MESSAGE=$message" >> $GITHUB_ENV
|
||||
export COMMIT_MESSAGE=$message
|
||||
if [[ "$COMMIT_MESSAGE" == [affected:*] ]]; then
|
||||
echo "Setting up CI to run with commit flag [affected:*] flag."
|
||||
echo "BREAK_ACTION=true" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: PULL_REQUEST event
|
||||
if: ${{ env.BREAK_ACTION == false && github.event_name == 'pull_request' && !github.event.pull_request.merged }}
|
||||
|
22
.github/workflows/pull-request.yml
vendored
22
.github/workflows/pull-request.yml
vendored
@@ -109,7 +109,21 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Check if PR is approved
|
||||
|
||||
- name: ci:force flag parser
|
||||
shell: bash
|
||||
run: |
|
||||
git fetch --all
|
||||
message=$(git log --format=%B -n 1 origin/${{ github.head_ref }})
|
||||
echo "COMMIT_MESSAGE=$message" >> $GITHUB_ENV
|
||||
export COMMIT_MESSAGE=$message
|
||||
if [[ "$COMMIT_MESSAGE" == *"[ci:force]"* ]]; then
|
||||
echo "Forcing CI to run with commit flag [ci:force]."
|
||||
echo CI_FORCE_RUN=true >> $GITHUB_ENV
|
||||
echo "BREAK_ACTION=true" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Get PR number
|
||||
id: action
|
||||
if: ${{ github.event_name != 'schedule' }}
|
||||
uses: kamatama41/get-pr-number-action@5c77b38a1b4974ebf8a9521a689f38a5898eadd6
|
||||
@@ -121,6 +135,12 @@ jobs:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
skip_check: "false"
|
||||
run: |
|
||||
echo "ci force run: $CI_FORCE_RUN"
|
||||
if [ "${CI_FORCE_RUN}" == "true" ]; then
|
||||
echo -e "\033[32m[ci:force] flag detected. No need for approval.\033[0m"
|
||||
skip_check="true"
|
||||
fi
|
||||
|
||||
if [ "${{ github.actor }}" == "dependabot[bot]" ] || [ "${{ github.actor }}" == "alfresco-build" ]; then
|
||||
echo -e "\033[32mCommit by ${{ github.actor }}. No need for approval.\033[0m"
|
||||
skip_check="true"
|
||||
|
Reference in New Issue
Block a user