-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔀️ Merge branch 'release/LekaApp/1.14.0'
- Loading branch information
Showing
70 changed files
with
2,083 additions
and
298 deletions.
There are no files selected for viewing
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
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
100 changes: 100 additions & 0 deletions
100
.github/workflows/ci-tools-cancel_workflows_on_pr_closed.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
# Leka - iOS Monorepo | ||
# Copyright APF France handicap | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: Cancel Workflows on PR Close or Label | ||
|
||
on: | ||
pull_request: | ||
types: [closed, labeled] | ||
|
||
jobs: | ||
cancel-workflows: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: write | ||
pull-requests: read | ||
steps: | ||
- name: Cancel Running Workflows Based on Event | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
const { owner, repo } = context.repo; | ||
const eventName = context.eventName; | ||
const action = context.payload.action; | ||
const currentRunId = context.runId; | ||
let prNumber; | ||
let prHeadSha; | ||
if (eventName === 'pull_request' && action === 'closed') { | ||
// Event triggered by PR closure | ||
prNumber = context.payload.pull_request.number; | ||
prHeadSha = context.payload.pull_request.head.sha; | ||
console.log(`Triggered by pull_request 'closed' event for PR #${prNumber}`); | ||
} else if (eventName === 'pull_request' && action === 'labeled') { | ||
// Event triggered by label addition | ||
prNumber = context.payload.pull_request.number; | ||
const labelName = context.payload.label.name; | ||
console.log(`Triggered by pull_request 'labeled' event for PR #${prNumber}`); | ||
console.log(`Label added: "${labelName}"`); | ||
// Check if the label matches the one we're interested in | ||
if (labelName !== '🛑️ cancel workflows') { | ||
console.log('Label does not match. Exiting.'); | ||
return; | ||
} | ||
prHeadSha = context.payload.pull_request.head.sha; | ||
} else { | ||
console.log('Unsupported event type or action. Exiting.'); | ||
return; | ||
} | ||
console.log(`PR Number: ${prNumber}`); | ||
console.log(`PR Head SHA: ${prHeadSha}`); | ||
console.log(`Current Run ID: ${currentRunId}`); | ||
// Fetch all in-progress and queued workflow runs | ||
const statuses = ['in_progress', 'queued', 'requested', 'waiting', 'pending']; | ||
let runs = []; | ||
for (const status of statuses) { | ||
const response = await github.rest.actions.listWorkflowRunsForRepo({ | ||
owner: owner, | ||
repo: repo, | ||
status: status, | ||
per_page: 100, | ||
head_sha: prHeadSha, | ||
}); | ||
runs = runs.concat(response.data.workflow_runs); | ||
} | ||
console.log(`Total in-progress or queued runs: ${runs.length}`); | ||
runs.forEach(run => { | ||
const runInfo = [ | ||
` - ID: ${run.id}`, | ||
` Name: ${run.name}`, | ||
` Head SHA: ${run.head_sha}`, | ||
` Event: ${run.event}`, | ||
` Status: ${run.status}` | ||
]; | ||
console.log(runInfo.join('\n')); | ||
}); | ||
// Cancel runs associated with the PR's head SHA, excluding the current run | ||
for (const run of runs) { | ||
if (run.id !== currentRunId && run.head_sha === prHeadSha) { | ||
try { | ||
await github.rest.actions.cancelWorkflowRun({ | ||
owner, | ||
repo, | ||
run_id: run.id, | ||
}); | ||
console.log(`Cancelled workflow run: ${run.id}`); | ||
} catch (error) { | ||
console.error(`Failed to cancel workflow run: ${run.id}. Error: ${error.message}`); | ||
} | ||
} | ||
} |
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
3 changes: 3 additions & 0 deletions
3
Apps/LekaApp/Resources/Assets.xcassets/AppIconBeta.appiconset/AppIconBeta.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions
36
Apps/LekaApp/Resources/Assets.xcassets/AppIconBeta.appiconset/Contents.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "AppIconBeta.jpg", | ||
"idiom" : "universal", | ||
"platform" : "ios", | ||
"size" : "1024x1024" | ||
}, | ||
{ | ||
"appearances" : [ | ||
{ | ||
"appearance" : "luminosity", | ||
"value" : "dark" | ||
} | ||
], | ||
"idiom" : "universal", | ||
"platform" : "ios", | ||
"size" : "1024x1024" | ||
}, | ||
{ | ||
"appearances" : [ | ||
{ | ||
"appearance" : "luminosity", | ||
"value" : "tinted" | ||
} | ||
], | ||
"idiom" : "universal", | ||
"platform" : "ios", | ||
"size" : "1024x1024" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Oops, something went wrong.