feat/test: test #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: github-call-update-submodule | |
on: | |
push: | |
branches: | |
- feat/test | |
jobs: | |
call-github-update-submodule: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Get Token | |
id: get_workflow_token | |
uses: peter-murray/workflow-application-token-action@v3 | |
with: | |
application_id: ${{ secrets.GH_APP_REPO_ACTION_RW_APPLICATION_ID }} | |
application_private_key: ${{ secrets.GH_APP_REPO_ACTION_RW_PRIVATE_KEY }} | |
revoke_token: true | |
- name: Read patterns from file | |
id: read_patterns | |
uses: opencepk/opencepk-module-ghactions-common/read-and-stringify-json-action@main | |
with: | |
file: '.github/META-REPO-PATTERNS' | |
file_type: 'file' | |
separator: '/\r?\n/' | |
output_format: ',' | |
- name: Print input values | |
run: | | |
echo "repo: ${{ github.repository }}" | |
echo "patterns: ${{ steps.read_patterns.outputs.output }}" | |
- name: Check if patterns is not empty | |
id: check_patterns | |
run: | | |
if [ -z "${{ steps.read_patterns.outputs.output }}" ]; then | |
echo "patterns is empty" | |
echo "::set-output name=should_trigger::false" | |
else | |
echo "::set-output name=should_trigger::true" | |
fi | |
continue-on-error: true | |
- name: Trigger reusable workflow via API | |
if: steps.check_patterns.outputs.should_trigger == 'true' | |
uses: opencepk/opencepk-module-ghactions-common/trigger-workflow-action@main | |
with: | |
token: ${{ steps.get_workflow_token.outputs.token }} | |
repo: 'opencepk/opencepk-projects-hub' | |
workflow_id: 'github-update-gitmodules.yml' | |
ref: 'main' | |
inputs: '{"repo":"${{ github.repository }}", "patterns":"${{ steps.read_patterns.outputs.output }}"}' |