From a337024531b50414e3ba8aebfff3af755bd5689b Mon Sep 17 00:00:00 2001 From: hminaee-tc Date: Fri, 23 Aug 2024 16:13:58 -0300 Subject: [PATCH] chore/add-git-modules cleanup --- .../call-github-update-submodule.yml | 36 +++++++++++++++++++ .../workflows/github-update-gitmodules.yml | 24 ------------- 2 files changed, 36 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/call-github-update-submodule.yml delete mode 100644 .github/workflows/github-update-gitmodules.yml diff --git a/.github/workflows/call-github-update-submodule.yml b/.github/workflows/call-github-update-submodule.yml new file mode 100644 index 0000000..21a044a --- /dev/null +++ b/.github/workflows/call-github-update-submodule.yml @@ -0,0 +1,36 @@ +# File: .github/workflows/call-github-update-submodule.yml +name: call-github-update-submodule + +on: + push: + branches: + - main + +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 + run: | + patterns=$(grep -v '^$' .github/META-REPO-PATTERNS | tr '\n' ',' | sed 's/,$//') + echo "patterns=$patterns" >> $GITHUB_ENV + + - name: Trigger reusable workflow via API + run: | + curl -X POST \ + -H "Accept: application/vnd.github.v3+json" \ + -H "Authorization: token ${{ steps.get_workflow_token.outputs.token }}" \ + -d '{"ref":"main", "inputs":{"repo":"${{ github.repository }}", "patterns":"${{ env.patterns }}"}}' \ + https://api.github.com/repos/opencepk/opencepk-projects-hub/actions/workflows/github-update-gitmodules.yml/dispatches \ No newline at end of file diff --git a/.github/workflows/github-update-gitmodules.yml b/.github/workflows/github-update-gitmodules.yml deleted file mode 100644 index c0a1d84..0000000 --- a/.github/workflows/github-update-gitmodules.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -name: github-update-gitmodules -on: - push: - branches: - - main - workflow_dispatch: -jobs: - update-submodules: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: '20' - - - name: Run GitHub Update Gitmodules Action - uses: opencepk/opencepk-module-ghactions-common/github-update-gitmodules@fix/update-gitmodules-action - with: - token: ${{ secrets.GITHUB_TOKEN }} - repo: ${{ github.repository }} \ No newline at end of file