@duckduckgo/autoconsent 12.15.0 → 12.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ Task/Issue URL:
2
+
3
+ ## Description:
4
+
5
+
6
+ ## Steps to test this PR:
7
+
@@ -1,4 +1,4 @@
1
- name: 'asana sync'
1
+ name: 'Asana Sync'
2
2
  on:
3
3
  pull_request_review:
4
4
  pull_request_target:
@@ -0,0 +1,29 @@
1
+ name: 'PR Merged Actions'
2
+
3
+ on:
4
+ pull_request_target:
5
+ types:
6
+ - closed
7
+
8
+ jobs:
9
+ process-asana-tasks:
10
+ runs-on: ubuntu-latest
11
+ if: github.event.pull_request.merged == true
12
+ steps:
13
+ - name: Find Asana task ID
14
+ id: find-task
15
+ uses: duckduckgo/native-github-asana-sync@v1.5
16
+ with:
17
+ action: 'find-asana-task-id'
18
+ asana-pat: ${{ secrets.ASANA_ACCESS_TOKEN }}
19
+ trigger-phrase: 'Task/Issue URL:'
20
+
21
+ - name: Move task to "Scheduled for release" section
22
+ if: steps.find-task.outputs.asanaTaskId
23
+ uses: duckduckgo/native-github-asana-sync@v1.5
24
+ with:
25
+ action: 'add-task-asana-project'
26
+ asana-pat: ${{ secrets.ASANA_ACCESS_TOKEN }}
27
+ asana-project: '1203268166580279' # CPM (Cookie Pop-up Management) Triage project
28
+ asana-section: '1207140808076253' # "Scheduled for release" section ID
29
+ asana-task-id: ${{ steps.find-task.outputs.asanaTaskId }}
@@ -0,0 +1,37 @@
1
+ name: 'PR Opened Actions'
2
+
3
+ on:
4
+ pull_request_target:
5
+ types:
6
+ - opened
7
+ - reopened
8
+
9
+ jobs:
10
+ process-asana-tasks:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - name: Add comment to Asana task
14
+ uses: duckduckgo/native-github-asana-sync@v1.5
15
+ with:
16
+ action: 'add-asana-comment'
17
+ asana-pat: ${{ secrets.ASANA_ACCESS_TOKEN }}
18
+ trigger-phrase: 'Task/Issue URL:'
19
+ is-pinned: 'false'
20
+
21
+ - name: Find Asana task ID
22
+ id: find-task
23
+ uses: duckduckgo/native-github-asana-sync@v1.5
24
+ with:
25
+ action: 'find-asana-task-id'
26
+ asana-pat: ${{ secrets.ASANA_ACCESS_TOKEN }}
27
+ trigger-phrase: 'Task/Issue URL:'
28
+
29
+ - name: Move task to "Awaiting review" section
30
+ if: steps.find-task.outputs.asanaTaskId
31
+ uses: duckduckgo/native-github-asana-sync@v1.5
32
+ with:
33
+ action: 'add-task-asana-project'
34
+ asana-pat: ${{ secrets.ASANA_ACCESS_TOKEN }}
35
+ asana-project: '1203268166580279' # CPM (Cookie Pop-up Management) Triage project
36
+ asana-section: '1209767000096488' # "Awaiting review" section ID
37
+ asana-task-id: ${{ steps.find-task.outputs.asanaTaskId }}
package/CHANGELOG.md CHANGED
@@ -1,3 +1,26 @@
1
+ # v12.16.0 (Tue Mar 25 2025)
2
+
3
+ #### 🚀 Enhancement
4
+
5
+ - Update EasyList Cookie to 43935b4bf6a715553ae4d2ccc628462fad8188f2 [#704](https://github.com/duckduckgo/autoconsent/pull/704) ([@muodov](https://github.com/muodov) [@github-actions[bot]](https://github.com/github-actions[bot]))
6
+ - Fix rule for bbb.org [#678](https://github.com/duckduckgo/autoconsent/pull/678) ([@muodov](https://github.com/muodov))
7
+
8
+ #### 🐛 Bug Fix
9
+
10
+ - Add Asana automations [#701](https://github.com/duckduckgo/autoconsent/pull/701) ([@noisysocks](https://github.com/noisysocks))
11
+ - Bump the dev-dependencies group with 5 updates [#702](https://github.com/duckduckgo/autoconsent/pull/702) ([@dependabot[bot]](https://github.com/dependabot[bot]))
12
+ - Bump tldts-experimental from 6.1.84 to 6.1.85 [#703](https://github.com/duckduckgo/autoconsent/pull/703) ([@dependabot[bot]](https://github.com/dependabot[bot]))
13
+ - Improve burpee.com rule [#698](https://github.com/duckduckgo/autoconsent/pull/698) ([@noisysocks](https://github.com/noisysocks))
14
+
15
+ #### Authors: 4
16
+
17
+ - [@dependabot[bot]](https://github.com/dependabot[bot])
18
+ - [@github-actions[bot]](https://github.com/github-actions[bot])
19
+ - Maxim Tsoy ([@muodov](https://github.com/muodov))
20
+ - Robert Anderson ([@noisysocks](https://github.com/noisysocks))
21
+
22
+ ---
23
+
1
24
  # v12.15.0 (Fri Mar 21 2025)
2
25
 
3
26
  #### 🚀 Enhancement
@@ -14,6 +14,7 @@ const releaseNotes = md.render(releaseNotesRaw);
14
14
  const templateTaskGid = '1206774921409831';
15
15
  const autoconsentProjectGid = '1201844467387842';
16
16
  const releaseSectionGid = '1202253736774466';
17
+ const scheduledForReleaseSectionGid = '1207140808076253';
17
18
  const projectExtractorRegex = /\[\[project_gids=(.*)]]/;
18
19
 
19
20
  /**
@@ -95,6 +96,32 @@ const waitForJobSuccess = async (job_gid) => {
95
96
  });
96
97
  };
97
98
 
99
+ /**
100
+ * Generates an HTML summary of the tasks in the "Scheduled for Release"
101
+ * section, then marks those tasks as completed.
102
+ *
103
+ * @returns {Promise<string>}
104
+ */
105
+ const processReleaseTasks = async () => {
106
+ const { data: tasks } = await asana.tasks.getTasksForSection(scheduledForReleaseSectionGid, {
107
+ opt_fields: 'name,permalink_url,completed',
108
+ completed_since: 'now', // Fetch only incomplete tasks
109
+ });
110
+
111
+ if (!tasks || tasks.length === 0) {
112
+ return '';
113
+ }
114
+
115
+ let taskListHtml = '<strong>Tasks included in this release:</strong>\n<ul>';
116
+ for (const task of tasks) {
117
+ taskListHtml += getLink(task.permalink_url) + '\n';
118
+ await asana.tasks.updateTask(task.gid, { completed: true });
119
+ }
120
+ taskListHtml += '</ul>';
121
+
122
+ return taskListHtml;
123
+ };
124
+
98
125
  const asanaCreateTasks = async () => {
99
126
  setupAsana();
100
127
 
@@ -106,7 +133,7 @@ const asanaCreateTasks = async () => {
106
133
  const updatedNotes = notes
107
134
  .replace('[[version]]', version)
108
135
  .replace('[[release_url]]', getLink(releaseUrl, 'Autoconsent Release'))
109
- .replace('[[notes]]', releaseNotes)
136
+ .replace('[[notes]]', [await processReleaseTasks(), releaseNotes].filter(Boolean).join('\n\n'))
110
137
  .replace(/<\/?p>/gi, '\n')
111
138
  // Asana supports only h1 and h2
112
139
  .replace(/<(h3|h4)>/gi, '<h2>')