Skip to content

Commit e264cab

Browse files
committed
Test workflow for new tokens
1 parent 8fb39c1 commit e264cab

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

.github/workflows/dev-test.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: Test
19+
20+
on:
21+
workflow_dispatch:
22+
23+
jobs:
24+
distribute:
25+
permissions:
26+
id-token: write
27+
contents: read
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Create a GitHub OIDC JWT
31+
id: create-github-jwt
32+
shell: bash
33+
run: |
34+
set -euo pipefail
35+
url="${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=atr-test-v1"
36+
jwt="$(curl -sS --fail-with-body -H "Authorization: bearer ${ACTIONS_ID_TOKEN_REQUEST_TOKEN}" "$url" | jq -r .value)"
37+
echo "::add-mask::$jwt"
38+
echo "jwt=$jwt" >> "$GITHUB_OUTPUT"
39+
40+
- name: Register the ephemeral SSH key with ATR
41+
shell: bash
42+
run: |
43+
set -euxo pipefail
44+
jq -n --arg publisher github \
45+
--arg jwt "$JWT" \
46+
'{publisher:$publisher, jwt:$jwt}' |
47+
curl -sS --fail-with-body -X POST -H 'Content-Type: application/json' -d @- \
48+
"https://interorbitally-palateless-jaunita.ngrok-free.dev/api/test"
49+
env:
50+
JWT: ${{ steps.create-github-jwt.outputs.jwt }}

0 commit comments

Comments
 (0)