Skip to content
Open
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
38 changes: 38 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Test pr
on:
pull_request:
types:
- opened
- synchronize
- reopened
jobs:
hehe:
runs-on: ubuntu-latest
strategy:
matrix:
bull: [1, 2, 3, 4, 5]
outputs:
hehe: ${{ steps.hehe.outputs.hehe }}
steps:
- run: echo "hehe=${{ matrix.bull }}" >> $GITHUB_OUTPUT
id: hehe
- uses: cloudposse/github-action-matrix-outputs-write@v1
id: out
with:
matrix-step-name: ${{ github.job }}
matrix-key: ${{ matrix.bull }}
outputs: |-
hehe: ${{ matrix.bull }}
ble: "bara prufa"
bull:
runs-on: ubuntu-latest
needs:
- hehe
steps:
- uses: cloudposse/github-action-matrix-outputs-read@v1
id: read
with:
matrix-step-name: hehe
- run: echo "${{ steps.read.outputs.result }}"


8 changes: 4 additions & 4 deletions ci/test.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-check
import github from "@actions/github";
import core from "@actions/core";

Expand All @@ -14,7 +15,7 @@ core.setOutput("ARTIFACT_NAME", artifactName);
core.setOutput("TAG_NAME", tagName);

function getTagname() {
if (eventName === "pull_request") {
if (eventName === "pull_request" && context.payload.pull_request?.number) {
return `pr-${context.payload.pull_request.number}-${randomTag}`;
}
if (eventName === "merge_group") {
Expand All @@ -29,9 +30,8 @@ function getTagname() {

}


function getArtifactname() {
if (eventName === "pull_request") {
if (eventName === "pull_request" && context.payload.pull_request?.number) {
return `pr-${context.payload.pull_request.number}`;
}
if (eventName === "merge_group") {
Expand Down Expand Up @@ -71,7 +71,7 @@ function getTypeOfDeployment() {


function getTargetBranch() {
if (eventName === "pull_request") {
if (eventName === "pull_request" && context.payload?.pull_request?.base.ref) {
return context.payload.pull_request.base.ref;
}
if (eventName === "merge_group") {
Expand Down
12 changes: 12 additions & 0 deletions ci/upload_artifacts.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// @ts-check

import artifact from "@actions/artifact";

const artifactName = process.env.ARTIFACT_NAME;
const tagName = process.env.TAG_NAME;
const artifact = generateArtifact();


function generateArtifact() {
return {};
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"packageManager": "yarn@4.2.2",
"devDependencies": {
"@actions/core": "^1.11.1",
"@actions/github": "^6.0.0"
"@actions/github": "^6.0.0",
"@types/node": "^22.13.4"
}
}
17 changes: 17 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,15 @@ __metadata:
languageName: node
linkType: hard

"@types/node@npm:^22.13.4":
version: 22.13.4
resolution: "@types/node@npm:22.13.4"
dependencies:
undici-types: "npm:~6.20.0"
checksum: 10c0/3a234fa7766a3efc382cf81f66f474c26cdab2f54f43f757634c81c0444eb2160c2dabbde9741e4983078a318a88515b65416b5f1ab5478548579d7b3ead1d95
languageName: node
linkType: hard

"before-after-hook@npm:^2.2.0":
version: 2.2.3
resolution: "before-after-hook@npm:2.2.3"
Expand All @@ -193,6 +202,7 @@ __metadata:
dependencies:
"@actions/core": "npm:^1.11.1"
"@actions/github": "npm:^6.0.0"
"@types/node": "npm:^22.13.4"
languageName: unknown
linkType: soft

Expand All @@ -219,6 +229,13 @@ __metadata:
languageName: node
linkType: hard

"undici-types@npm:~6.20.0":
version: 6.20.0
resolution: "undici-types@npm:6.20.0"
checksum: 10c0/68e659a98898d6a836a9a59e6adf14a5d799707f5ea629433e025ac90d239f75e408e2e5ff086afc3cace26f8b26ee52155293564593fbb4a2f666af57fc59bf
languageName: node
linkType: hard

"undici@npm:^5.25.4":
version: 5.28.5
resolution: "undici@npm:5.28.5"
Expand Down