Update dependency pointfreeco/swift-dependencies to from: "1.5.0" #225
This file contains 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: Renovate | |
on: | |
pull_request: | |
paths: | |
- .github/workflows/renovate.yml | |
- SSLCertificateCheckPackage/Package.swift | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref }} | |
cancel-in-progress: true | |
jobs: | |
precheck: | |
runs-on: ubuntu-latest | |
if: startsWith(github.head_ref, 'renovate/') | |
permissions: | |
contents: read | |
pull-requests: read | |
outputs: | |
result: ${{ steps.parse.outputs.result }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: tj-actions/changed-files@v45 | |
id: files_changes | |
with: | |
json: "true" | |
quotepath: "false" | |
escape_json: "false" | |
- name: Parse | |
shell: python | |
id: parse | |
env: | |
MODIFIED_FILES: ${{ steps.files_changes.outputs.modified_files }} | |
run: | | |
import json | |
import os | |
plain = os.getenv("MODIFIED_FILES", "[]") | |
plain = plain.replace("\\\"", "\"") | |
modified_files = json.loads(plain) | |
resolved_files_path = "SSLCertificateCheck.xcworkspace/xcshareddata/swiftpm/Package.resolved" | |
result = "resolve" if resolved_files_path not in modified_files else "skip" | |
with open(os.getenv("GITHUB_OUTPUT"), "a") as f: | |
output = f"result={result}" | |
print(output, file=f) | |
resolve-swift-packages: | |
runs-on: macos-14 | |
needs: precheck | |
if: needs.precheck.outputs.result == 'resolve' | |
env: | |
DEVELOPER_DIR: /Applications/Xcode_16.app/Contents/Developer | |
steps: | |
- uses: Cyberbeni/install-swift-tool@v2 | |
with: | |
url: https://github.com/nnsnodnb/github-apps-token-swift | |
version: '*' | |
- uses: 1password/load-secrets-action@v2 | |
with: | |
export-env: true | |
env: | |
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} | |
APP_PRIVATE_KEY: op://aoi-chan-bot/GitHubApp/aoi-chan-bot.private-key.pem | |
- name: Configure Access Token for GitHub Apps | |
id: get-github-app | |
env: | |
APP_ID: ${{ secrets.APP_ID }} | |
run: | | |
echo "${APP_PRIVATE_KEY}" > /tmp/github-apps-private-key.pem | |
token=$(github-apps-token create \ | |
-a "${APP_ID}" \ | |
-p /tmp/github-apps-private-key.pem \ | |
--owner nnsnodnb \ | |
-r ssl-certificates-check-ios \ | |
--contents write) | |
echo "token=${token}" >> "${GITHUB_OUTPUT}" | |
rm /tmp/github-apps-private-key.pem | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ steps.get-github-app.outputs.token }} | |
- name: Cache Swift Packages | |
uses: actions/cache@v4 | |
with: | |
path: .swiftpm | |
key: ${{ runner.os }}-swiftpm-${{ hashFiles('SSLCertificateCheck.xcworkspace/xcshareddata/swiftpm/Package.resolved') }} | |
- name: Resolve Swift Packages | |
run: xcodebuild -resolvePackageDependencies -scheme SSLCertificateCheckPackage -workspace SSLCertificateCheck.xcworkspace -clonedSourcePackagesDirPath .swiftpm | |
- name: Git Config | |
run: | | |
git config --global user.email "aoi-chan-bot[bot]@users.noreply.github.com" | |
git config --global user.name "aoi-chan-bot[bot]" | |
- name: Commit & Push | |
env: | |
HEAD_REF: ${{ github.head_ref }} | |
run: | | |
git add SSLCertificateCheck.xcworkspace/xcshareddata/swiftpm/Package.resolved | |
if git commit -m "Resolve Swift Package"; then | |
git push origin "HEAD:${HEAD_REF}" | |
fi | |
- name: Revoke Access Token for GitHub Apps | |
if: success() || failure() | |
run: | | |
if [[ -n "${{ steps.get-github-app.outputs.token }}" ]]; then | |
github-apps-token revoke --token "${{ steps.get-github-app.outputs.token }}" | |
fi |