Skip to content

[ETH-780] Referral reward history item #316

[ETH-780] Referral reward history item

[ETH-780] Referral reward history item #316

Workflow file for this run

name: Swiftformat
on:
pull_request:
paths:
- '.github/workflows/swiftformat.yml'
- '.swiftformat'
- '**/*.swift'
concurrency:
group: swiftformat-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
SwiftLint:
runs-on: macos-latest
steps:
- name: Check out current branch
uses: actions/checkout@v3
with:
ref: ${{ inputs.branch != '' && inputs.branch || github.event.pull_request.head.ref }}
- name: Swiftformat
env:
REPO_OWNER: "p2p-org"
REPO_NAME: "p2p-wallet-ios"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
chmod u+x Scripts/format_and_pull_request.sh
Scripts/format_and_pull_request.sh
- name: Comment to Pull request
id: write-comment
run: |
if [ -n "$PR_URL" ]; then
# Customize your comment message here
COMMENT="Thank you for your contribution! We detected unformatted code and fixed them for you here: [${{ env.PR_URL }}](${{ env.PR_URL }})"
# Get the pull request number
PR_NUMBER=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')
# Create a comment using GitHub API
RESPONSE=$(curl -X POST \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
-d "{\"body\": \"$COMMENT\"}" \
"https://api.github.com/repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/comments")
# Print response for debugging
echo "$RESPONSE"
exit 1
else
exit 0
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}