Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@
jobs:

build:
runs-on: macos-14 # Apple Silicon Runner
runs-on: macos-15 # Apple Silicon Runner

steps:
- uses: actions/checkout@v4
- uses: n1hility/cancel-previous-runs@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Select latest Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.4'

- name: 🛠️ Build with release configuration
run: |
swift build --configuration release | xcpretty --utf --color && exit ${PIPESTATUS[0]}

- uses: actions/upload-artifact@v4
with:
name: 'public-api-diff'
path: '.build/release/public-api-diff'
if-no-files-found: 'error'
retention-days: 0

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

2 changes: 1 addition & 1 deletion .github/workflows/detect-api-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,78 +14,78 @@

jobs:
build:
runs-on: macos-14 # Apple Silicon Runner
runs-on: macos-15 # Apple Silicon Runner

steps:
- uses: actions/checkout@v4
- uses: n1hility/cancel-previous-runs@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Select latest Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.4'

- name: 🚚 Fetch repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: 👾 Define Diff Versions
run: |
NEW="${{ env.source }}~${{ env.headGithubRepo }}"
OLD="${{ env.target }}~${{ env.baseGithubRepo }}"

if [[ '${{ env.targetBranchName || env.noTargetBranch }}' == release/* ]]
then
LATEST_TAG=$(git describe --tags --abbrev=0)
OLD="$LATEST_TAG~${{ env.baseGithubRepo }}"
fi

# Providing the output to the environment
echo "OLD_VERSION=$OLD" >> $GITHUB_ENV
echo "NEW_VERSION=$NEW" >> $GITHUB_ENV
env:
source: '${{ github.event.inputs.new || github.head_ref }}'
target: '${{ github.event.inputs.old || github.event.pull_request.base.ref }}'
headGithubRepo: '${{github.server_url}}/${{ github.event.pull_request.head.repo.full_name || github.repository}}.git'
baseGithubRepo: '${{github.server_url}}/${{github.repository}}.git'
noTargetBranch: 'no target branch'
targetBranchName: '${{ github.head_ref }}'

- name: 🧰 Build Swift CLI
run: swift build --configuration release

- name: 🏃 Run Diff
run: |
NEW=${{ env.NEW_VERSION }}
OLD=${{ env.OLD_VERSION }}
PLATFORM="macOS"
PROJECT_FOLDER=${{ github.workspace }}
BINARY_PATH="$(swift build --configuration release --show-bin-path)/public-api-diff"

echo "▶️ Running binary at $BINARY_PATH"
$BINARY_PATH project --new "$NEW" --old "$OLD" --platform "$PLATFORM" --output "$PROJECT_FOLDER/api_comparison.md" --log-output "$PROJECT_FOLDER/logs.txt"
cat "$PROJECT_FOLDER/logs.txt"

if [[ ${{ env.HEAD_GITHUB_REPO != env.BASE_GITHUB_REPO }} ]]; then
echo "---" >> $GITHUB_STEP_SUMMARY
echo "> [!IMPORTANT]" >> $GITHUB_STEP_SUMMARY
echo "> **Commenting on pull requests from forks is not possible** due to insufficient permissions." >> $GITHUB_STEP_SUMMARY
echo "> Once merged, the output will be posted as an auto-updating comment under the pull request." >> $GITHUB_STEP_SUMMARY
echo "---" >> $GITHUB_STEP_SUMMARY
fi

cat "$PROJECT_FOLDER/api_comparison.md" >> $GITHUB_STEP_SUMMARY

# We only want to comment if we're in a Pull Request and if the Pull Request is not from a forked Repository
# Forked Repositories have different rights for security reasons and thus it's not possible to comment on PRs without lowering the security
# once the tool is merged the base repo rights apply and the script can comment on PRs as expected.
- if: ${{ github.event.pull_request.base.ref != '' && env.HEAD_GITHUB_REPO == env.BASE_GITHUB_REPO }}
name: 📝 Comment on PR
uses: thollander/actions-comment-pull-request@v3
with:
file-path: "${{ github.workspace }}/api_comparison.md"
comment-tag: api_changes
mode: recreate

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Loading