|
| 1 | +name: BRS Commit Checker Report |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + inputs: |
| 5 | + fix_version: |
| 6 | + type: string |
| 7 | + required: true |
| 8 | + description: The ICU Jira "Fix Version" semver |
| 9 | + from_git_ref: |
| 10 | + type: string |
| 11 | + required: true |
| 12 | + description: The git ref start of comparison range. Prefix branches with `origin/`. |
| 13 | + end_git_ref: |
| 14 | + type: string |
| 15 | + required: true |
| 16 | + description: The git ref end of comparison range. Must be descendant of `from_git_ref`. Prefix branches with `origin/`. |
| 17 | + # Jira user name & API token is used for processing sensitive tickets comes from Github Secrets |
| 18 | + # stored in the repository |
| 19 | + |
| 20 | +jobs: |
| 21 | + commit-report: |
| 22 | + runs-on: ubuntu-latest |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v4 |
| 25 | + with: |
| 26 | + fetch-tags: true |
| 27 | + fetch-depth: 0 |
| 28 | + # workaround for bug in checkout action. this step should be redundant. |
| 29 | + # https://github.com/actions/checkout/issues/1471 |
| 30 | + # https://github.com/actions/checkout/issues/1781 |
| 31 | + # https://github.com/actions/checkout/issues/701#issuecomment-1133937950 |
| 32 | + - name: Fetch all tags |
| 33 | + run: | |
| 34 | + git fetch --tags origin |
| 35 | + - name: Fetch all branches |
| 36 | + run: | |
| 37 | + git fetch origin |
| 38 | + - name: Setup Python |
| 39 | + uses: actions/setup-python@v5 |
| 40 | + with: |
| 41 | + python-version: '3.12.8' |
| 42 | + cache: 'pipenv' |
| 43 | + cache-dependency-path: | |
| 44 | + tools/commit-checker/Pipfile |
| 45 | + tools/commit-checker/Pipfile.lock |
| 46 | + - name: Install pipenv |
| 47 | + run: | |
| 48 | + sudo pip3 install pipenv |
| 49 | + - name: Generate report |
| 50 | + env: |
| 51 | + JIRA_USERNAME: ${{ secrets.COMMIT_CHECKER_JIRA_EMAIL }} |
| 52 | + JIRA_PASSWORD: ${{ secrets.COMMIT_CHECKER_JIRA_TOKEN }} |
| 53 | + run: | |
| 54 | + pushd ./tools/commit-checker |
| 55 | + pipenv install |
| 56 | + pipenv run python3 check.py \ |
| 57 | + --jira-query "project=ICU AND fixVersion=${{ inputs.fix_version }}" \ |
| 58 | + --rev-range "${{ inputs.from_git_ref }}..${{ inputs.end_git_ref }}" > REPORT.md |
| 59 | + popd |
| 60 | + # https://github.blog/news-insights/product-news/supercharging-github-actions-with-job-summaries/ |
| 61 | + - name: Reproduce report as workflow job summary |
| 62 | + run: | |
| 63 | + cat ./tools/commit-checker/REPORT.md >> $GITHUB_STEP_SUMMARY |
| 64 | + echo "View the Summary page of this GHA Workflow instance to view the rendered Markdown of this report." |
0 commit comments