Skip to content

Commit

Permalink
Merge branch 'dominik/assign-tasks-to-actor' into dominik/test-base-b…
Browse files Browse the repository at this point in the history
…ranch
  • Loading branch information
ayoy committed Mar 6, 2024
2 parents d20742e + 1a85680 commit 4329db1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/bump_internal_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ jobs:
*) echo "👎 Not a release branch"; exit 1 ;;
esac
- name: Check out the code
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}

- name: Extract Asana Task ID
id: task-id
uses: ./.github/actions/asana-extract-task-id
with:
task-url: ${{ github.event.inputs.asana-task-url }}

- name: Check out the code
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}

- name: Validate release notes
env:
TASK_ID: ${{ steps.task-id.outputs.task-id }}
Expand All @@ -49,8 +49,8 @@ jobs:
curl -fLSs "https://app.asana.com/api/1.0/tasks/${TASK_ID}?opt_fields=notes" \
-H "Authorization: Bearer ${ASANA_ACCESS_TOKEN}" \
| jq -r .data.notes \
| ./scripts/extract_release_notes.sh) > release_notes.txt
release_notes="$(<release_notes)"
| ./scripts/extract_release_notes.sh > release_notes.txt
release_notes="$(<release_notes.txt)"
if [[ ${#release_notes} == 0 || "$release_notes" == "<-- Add release notes here -->" ]]; then
echo "::error::Release notes are empty. Please add release notes to the Asana task and restart the workflow."
exit 1
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/code_freeze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,19 @@ jobs:
git config --global user.name "Dax the Duck"
git config --global user.email "[email protected]"
bundle exec fastlane make_release_branch
- name: Get Asana user ID
id: get-asana-user-id
uses: duckduckgo/apple-infra/actions/asana-get-user-id-for-github-handle@main
with:
access-token: ${{ secrets.ASANA_ACCESS_TOKEN }}
github-handle: ${{ github.actor }}

- name: Create release task
id: create_release_task
env:
ASANA_ACCESS_TOKEN: ${{ secrets.ASANA_ACCESS_TOKEN }}
ASSIGNEE_ID: ${{ steps.get-asana-user-id.outputs.user-id }}
run: |
version="$(echo ${{ steps.make_release_branch.outputs.release_branch_name }} | cut -d '/' -f 2)"
task_name="macOS App Release $version"
Expand All @@ -60,14 +68,11 @@ jobs:
--output /dev/null \
-d "{\"data\": {\"task\": \"${asana_task_id}\"}}"
assignee_id="$(curl -fLSs https://raw.githubusercontent.com/duckduckgo/BrowserServicesKit/main/.github/actions/asana-failed-pr-checks/user_ids.json \
| jq -r .${{ github.actor }})"
curl -fLSs -X PUT "https://app.asana.com/api/1.0/tasks/${asana_task_id}" \
-H "Authorization: Bearer ${{ env.ASANA_ACCESS_TOKEN }}" \
-H "Content-Type: application/json" \
--output /dev/null \
-d "{ \"data\": { \"assignee\": \"$assignee_id\" }}"
-d "{ \"data\": { \"assignee\": \"$ASSIGNEE_ID\" }}"
- name: Update Asana tasks for the release
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish_dmg_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ jobs:
curl -fLSs "https://app.asana.com/api/1.0/tasks/${TASK_ID}?opt_fields=notes" \
-H "Authorization: Bearer ${ASANA_ACCESS_TOKEN}" \
| jq -r .data.notes \
| ./scripts/extract_release_notes.sh) > release_notes.txt
release_notes="$(<release_notes)"
| ./scripts/extract_release_notes.sh > release_notes.txt
release_notes="$(<release_notes.txt)"
if [[ ${#release_notes} == 0 || "$release_notes" == "<-- Add release notes here -->" ]]; then
echo "::error::Release notes are empty. Please add release notes to the Asana task and restart the workflow."
exit 1
Expand Down

0 comments on commit 4329db1

Please sign in to comment.