Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions patches/nextcloud/sync-workflow-templates.yml.patch
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
+ - name: Create LibreCode GitHub App token
+ if: ${{ vars.WORKFLOW_SYNC_AUTH_MODE == '' || vars.WORKFLOW_SYNC_AUTH_MODE == 'librecode-app' }}
+ id: librecode-app-token
+ uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4
+ uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
+ with:
+ app-id: ${{ vars.LIBRECODE_WORKFLOW_APP_ID }}
+ private-key: ${{ secrets.LIBRECODE_WORKFLOW_APP_PRIVATE_KEY }}
Expand All @@ -89,7 +89,7 @@
+ - name: Create consumer GitHub App token
+ if: ${{ vars.WORKFLOW_SYNC_AUTH_MODE == 'github-app' }}
+ id: consumer-app-token
+ uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4
+ uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
+ with:
+ app-id: ${{ vars.WORKFLOW_SYNC_APP_ID }}
+ private-key: ${{ secrets.WORKFLOW_SYNC_APP_PRIVATE_KEY }}
Expand Down
12 changes: 12 additions & 0 deletions tests/test_portable_workflow_sync_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ def test_librecode_app_credentials_use_actions_variable_and_secret(self) -> None
self.assertIn("app-id: ${{ vars.LIBRECODE_WORKFLOW_APP_ID }}", content)
self.assertNotIn("secrets.LIBRECODE_WORKFLOW_APP_ID", content)

def test_github_app_token_action_is_current_and_pinned(self) -> None:
content = TEMPLATE.read_text(encoding="utf-8")
sha = "bcd2ba49218906704ab6c1aa796996da409d3eb1"

self.assertEqual(
content.count(
f"actions/create-github-app-token@{sha} # v3.2.0"
),
2,
)
self.assertNotIn("actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42", content)

def test_generated_pull_request_uses_selected_token(self) -> None:
content = TEMPLATE.read_text(encoding="utf-8")

Expand Down
4 changes: 2 additions & 2 deletions workflow-templates/sync-workflow-templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
- name: Create LibreCode GitHub App token
if: ${{ vars.WORKFLOW_SYNC_AUTH_MODE == '' || vars.WORKFLOW_SYNC_AUTH_MODE == 'librecode-app' }}
id: librecode-app-token
uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ vars.LIBRECODE_WORKFLOW_APP_ID }}
private-key: ${{ secrets.LIBRECODE_WORKFLOW_APP_PRIVATE_KEY }}
Expand All @@ -97,7 +97,7 @@ jobs:
- name: Create consumer GitHub App token
if: ${{ vars.WORKFLOW_SYNC_AUTH_MODE == 'github-app' }}
id: consumer-app-token
uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ vars.WORKFLOW_SYNC_APP_ID }}
private-key: ${{ secrets.WORKFLOW_SYNC_APP_PRIVATE_KEY }}
Expand Down
Loading