|
25 | 25 | - name: Select latest Xcode
|
26 | 26 | uses: maxim-lobanov/setup-xcode@v1
|
27 | 27 | with:
|
28 |
| - xcode-version: '15.4' |
| 28 | + xcode-version: '16.1' |
29 | 29 |
|
30 | 30 | - name: 🚚 Fetch repo
|
31 | 31 | uses: actions/checkout@v4
|
@@ -54,11 +54,35 @@ jobs:
|
54 | 54 | target: '${{ github.event.inputs.old || github.event.pull_request.base.ref }}'
|
55 | 55 | githubRepo: '${{github.server_url}}/${{github.repository}}.git'
|
56 | 56 | noTargetBranch: 'no target branch'
|
| 57 | + |
| 58 | + - name: 🏃 Run Diff |
| 59 | + run: | |
| 60 | + NEW=${{ inputs.new }} |
| 61 | + OLD=${{ inputs.old }} |
| 62 | + PLATFORM=${{ inputs.platform }} |
| 63 | + PROJECT_FOLDER=${{ github.workspace }} |
| 64 | + |
| 65 | + swift run public-api-diff project --new "$NEW" --old "$OLD" --platform "$PLATFORM" --output "$PROJECT_FOLDER/api_comparison.md" --log-output "$PROJECT_FOLDER/logs.txt" |
| 66 | + cat "$PROJECT_FOLDER/logs.txt" |
| 67 | +
|
| 68 | + if [[ ${{ env.HEAD_GITHUB_REPO != env.BASE_GITHUB_REPO }} ]]; then |
| 69 | + echo "---" >> $GITHUB_STEP_SUMMARY |
| 70 | + echo "> [!IMPORTANT]" >> $GITHUB_STEP_SUMMARY |
| 71 | + echo "> **Commenting on pull requests from forks is not possible** due to insufficient permissions." >> $GITHUB_STEP_SUMMARY |
| 72 | + echo "> Once merged, the output will be posted as an auto-updating comment under the pull request." >> $GITHUB_STEP_SUMMARY |
| 73 | + echo "---" >> $GITHUB_STEP_SUMMARY |
| 74 | + fi |
| 75 | + |
| 76 | + cat "$PROJECT_FOLDER/api_comparison.md" >> $GITHUB_STEP_SUMMARY |
| 77 | + shell: bash |
57 | 78 |
|
58 |
| - - name: 🔍 Detect Changes |
59 |
| - uses: ./ # Uses the action.yml that's at the root of the repository |
60 |
| - id: public_api_diff |
| 79 | + # We only want to comment if we're in a Pull Request and if the Pull Request is not from a forked Repository |
| 80 | + # Forked Repositories have different rights for security reasons and thus it's not possible to comment on PRs without lowering the security |
| 81 | + # once the tool is merged the base repo rights apply and the script can comment on PRs as expected. |
| 82 | + - if: ${{ github.event.pull_request.base.ref != '' && env.HEAD_GITHUB_REPO == env.BASE_GITHUB_REPO }} |
| 83 | + name: 📝 Comment on PR |
| 84 | + uses: thollander/actions-comment-pull-request@v3 |
61 | 85 | with:
|
62 |
| - platform: "macOS" |
63 |
| - new: ${{ env.NEW_VERSION }} |
64 |
| - old: ${{ env.OLD_VERSION }} |
| 86 | + file-path: "${{ github.workspace }}/api_comparison.md" |
| 87 | + comment-tag: api_changes |
| 88 | + mode: recreate |
0 commit comments