Update plugins repository references #28
This file contains hidden or 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: Update plugins repository references | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| regexps: | |
| description: line-separated list of regular expressions of the plugin packages to discover. An expression surrounded by single quotes is taken as a litteral package name. | |
| type: string | |
| required: false | |
| default: "" | |
| workspace-path: | |
| description: relative path of a workspace the discovery should be focused on | |
| type: string | |
| required: false | |
| default: "" | |
| allow-workspace-addition: | |
| description: allow creating PRs that will add workspaces | |
| type: boolean | |
| required: false | |
| release-branch-pattern: | |
| description: A regular expression that defines the watched branches. | |
| type: string | |
| required: false | |
| default: ^main$ | |
| verbose: | |
| description: enable verbose logs | |
| type: boolean | |
| required: false | |
| default: false | |
| debug: | |
| description: enable debug mode in bash scripts | |
| type: boolean | |
| required: false | |
| default: false | |
| workflow_call: | |
| inputs: | |
| regexps: | |
| description: line-separated list of regular expressions of the plugin packages to discover. An expression surrounded by single quotes is taken as a litteral package name. | |
| type: string | |
| required: false | |
| default: "" | |
| workspace-path: | |
| description: relative path of a workspace the discovery should be focused on | |
| type: string | |
| required: false | |
| default: "" | |
| pr-to-update: | |
| type: string | |
| required: false | |
| default: "" | |
| allow-workspace-addition: | |
| description: allow creating PRs that will add workspaces | |
| type: boolean | |
| required: false | |
| release-branch-pattern: | |
| description: A regular expression that defines the watched branches. | |
| type: string | |
| required: false | |
| default: ^main$ | |
| verbose: | |
| description: enable verbose logs | |
| type: boolean | |
| required: false | |
| default: false | |
| debug: | |
| description: enable debug mode in bash scripts | |
| type: boolean | |
| required: false | |
| default: false | |
| schedule: | |
| - cron: '0 12 * * *' | |
| - cron: '0 19 * * *' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event_name }}-${{ inputs.pr-to-update }} | |
| cancel-in-progress: true | |
| jobs: | |
| prepare: | |
| runs-on: ubuntu-latest | |
| name: Prepare | |
| outputs: | |
| regexps: ${{ steps.read-regexps.outputs.regexps }} | |
| steps: | |
| - uses: actions/checkout@v4.2.2 | |
| - name: Read Regexps | |
| id: read-regexps | |
| shell: bash | |
| run: | | |
| regexps="${{ inputs.regexps }}" | |
| if [[ "${regexps}" == "" ]] | |
| then | |
| regexps="$(cat plugins-regexps)" | |
| fi | |
| echo "Regexps of plugins to export:" | |
| echo "$regexps" | |
| echo "regexps=$(echo $regexps | tr '\n' ' ')" >> $GITHUB_OUTPUT | |
| update-branches: | |
| name: Update Branches | |
| needs: prepare | |
| if: github.event_name != 'schedule' | |
| uses: redhat-developer/rhdh-plugin-export-utils/.github/workflows/update-plugins-repo-refs.yaml@main | |
| with: | |
| regexps: ${{ needs.prepare.outputs.regexps }} | |
| workspace-path: ${{ inputs.workspace-path }} | |
| pr-to-update: ${{ inputs.pr-to-update }} | |
| overlay-repo: ${{ github.repository }} | |
| release-branch-pattern: ${{ inputs.release-branch-pattern }} | |
| verbose: ${{ inputs.verbose != '' && inputs.verbose }} | |
| debug: ${{ inputs.debug != '' && inputs.debug }} | |
| allow-workspace-addition: ${{ inputs.allow-workspace-addition != '' && inputs.allow-workspace-addition }} | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| update-release-branches: | |
| name: Update Release Branches | |
| needs: prepare | |
| if: >- | |
| (github.event_name == 'schedule' && github.event.schedule == '0 12 * * *') || | |
| (github.event_name == 'workflow_dispatch' && github.event.inputs.branch-type == 'releases') | |
| uses: redhat-developer/rhdh-plugin-export-utils/.github/workflows/update-plugins-repo-refs.yaml@main | |
| with: | |
| regexps: ${{ needs.prepare.outputs.regexps }} | |
| workspace-path: ${{ inputs.workspace-path }} | |
| overlay-repo: ${{ github.repository }} | |
| release-branch-pattern: ^release-(1\.6|1\.7)$ | |
| verbose: ${{ inputs.verbose != '' && inputs.verbose }} | |
| debug: ${{ inputs.debug != '' && inputs.debug }} | |
| allow-workspace-addition: false | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| update-main-branch: | |
| name: Update Main Branch | |
| needs: prepare | |
| if: >- | |
| (github.event_name == 'schedule' && github.event.schedule == '0 19 * * *') | |
| uses: redhat-developer/rhdh-plugin-export-utils/.github/workflows/update-plugins-repo-refs.yaml@main | |
| with: | |
| regexps: ${{ needs.prepare.outputs.regexps }} | |
| workspace-path: ${{ inputs.workspace-path }} | |
| overlay-repo: ${{ github.repository }} | |
| release-branch-pattern: ^main$ | |
| verbose: ${{ inputs.verbose != '' && inputs.verbose }} | |
| debug: ${{ inputs.debug != '' && inputs.debug }} | |
| allow-workspace-addition: true | |
| permissions: | |
| contents: write | |
| pull-requests: write |