Compare commits
42 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d7ae6f88f1 | |||
| 588c457cea | |||
| 82985934af | |||
| cb3ec583e0 | |||
| 7c3b116b19 | |||
| 4a6134be6c | |||
| 0080226132 | |||
| 896f780991 | |||
| 63b170f2a6 | |||
| 94451fa8f2 | |||
| 41e05b8ad1 | |||
| 5362fb1841 | |||
| 4e1f7cd9ac | |||
| 5c785ab41b | |||
| 9d246960f3 | |||
| eefd820cc5 | |||
| 58712f4d46 | |||
| 0bd67083ff | |||
| 40c20d5504 | |||
| c6cde72b37 | |||
| d47636092a | |||
| e292f8ca51 | |||
| 8f4080074b | |||
| b04e5db100 | |||
| 2795997f4c | |||
| 413ae51185 | |||
| 8bc0c5636e | |||
| 58bf3b35cc | |||
| 124ee84d1f | |||
| c4d478d459 | |||
| 9945ec321b | |||
| 5cb4007629 | |||
| 07fa29649e | |||
| 7bb2962bb0 | |||
| 3904c64796 | |||
| 48ad5e5251 | |||
| 317c4fcd63 | |||
| bf97052855 | |||
| dd8930fd74 | |||
| 2449e5cea1 | |||
| dba3cf5d96 | |||
| 804f83828f |
@@ -1,13 +1,18 @@
|
||||
name: Create release PR
|
||||
|
||||
run-name: Create release PR for v${{ github.event.inputs.version }}
|
||||
run-name: Create release PR for new ${{ github.event.inputs.version }} version
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
required: true
|
||||
description: "Version to bump `package.json` to (format: x.y.z)"
|
||||
type: choice
|
||||
description: "What type of release is this"
|
||||
options:
|
||||
- "major"
|
||||
- "minor"
|
||||
- "patch"
|
||||
|
||||
jobs:
|
||||
create-release-pr:
|
||||
@@ -31,21 +36,27 @@ jobs:
|
||||
git config --global user.email "github-actions@github.com"
|
||||
git config --global user.name "GitHub Actions"
|
||||
|
||||
git checkout -b release/${{ inputs.version }}
|
||||
NEW_VERSION=$(./script/workflows/increment-version.sh ${{ inputs.version }})
|
||||
|
||||
npx lerna version ${{ inputs.version }} --yes --no-push --no-git-tag-version --force-publish
|
||||
git checkout -b release/$NEW_VERSION
|
||||
|
||||
npx lerna version $NEW_VERSION --yes --no-push --no-git-tag-version --force-publish
|
||||
|
||||
git add **/package.json package-lock.json lerna.json
|
||||
git commit -m "Release extension version ${{ inputs.version }}"
|
||||
git commit -m "Release extension version $NEW_VERSION"
|
||||
|
||||
git push --set-upstream origin release/${{ inputs.version }}
|
||||
git push --set-upstream origin release/$NEW_VERSION
|
||||
|
||||
echo "new_version=$NEW_VERSION" >> $GITHUB_ENV
|
||||
|
||||
- name: Create PR
|
||||
run: |
|
||||
LAST_PR=$(gh pr list --repo ${{ github.repository }} --limit 1 --state merged --search "Release version" --json number | jq -r '.[0].number')
|
||||
./script/workflows/generate-release-notes.sh $LAST_PR ${{ env.new_version }}
|
||||
gh pr create \
|
||||
--title "Release version ${{ inputs.version }}" \
|
||||
--body "Release version ${{ inputs.version }}" \
|
||||
--title "Release version ${{ env.new_version }}" \
|
||||
--body-file releasenotes.md \
|
||||
--base main \
|
||||
--head release/${{ inputs.version }}
|
||||
--head release/${{ env.new_version }}
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@actions/expressions",
|
||||
"version": "0.3.3",
|
||||
"version": "0.3.5",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"source": "./src/index.ts",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@actions/languageserver",
|
||||
"version": "0.3.3",
|
||||
"version": "0.3.5",
|
||||
"description": "Language server for GitHub Actions",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
@@ -43,8 +43,8 @@
|
||||
"watch": "tsc --build tsconfig.build.json --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/languageservice": "^0.3.3",
|
||||
"@actions/workflow-parser": "^0.3.3",
|
||||
"@actions/languageservice": "^0.3.5",
|
||||
"@actions/workflow-parser": "^0.3.5",
|
||||
"@octokit/rest": "^19.0.7",
|
||||
"@octokit/types": "^9.0.0",
|
||||
"vscode-languageserver": "^8.0.2",
|
||||
|
||||
@@ -28,6 +28,7 @@ export async function getSecrets(
|
||||
}
|
||||
|
||||
const eventsConfig = workflowContext?.template?.events;
|
||||
|
||||
if (eventsConfig?.workflow_call) {
|
||||
// Unpredictable secrets may be passed in via a workflow_call trigger
|
||||
secretsContext.complete = false;
|
||||
@@ -38,6 +39,7 @@ export async function getSecrets(
|
||||
}
|
||||
|
||||
let environmentName: string | undefined;
|
||||
|
||||
if (workflowContext?.job?.environment) {
|
||||
if (isString(workflowContext.job.environment)) {
|
||||
environmentName = workflowContext.job.environment.value;
|
||||
@@ -46,10 +48,17 @@ export async function getSecrets(
|
||||
if (isString(x.key) && x.key.value === "name") {
|
||||
if (isString(x.value)) {
|
||||
environmentName = x.value.value;
|
||||
} else {
|
||||
// this means we have a dynamic enviornment, in those situations we
|
||||
// want to make sure we skip doing secret validation
|
||||
secretsContext.complete = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// if the expression is something like environment: ${{ ... }} then we want to skip validation
|
||||
secretsContext.complete = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ import {File} from "@actions/workflow-parser/workflows/file";
|
||||
import {FileProvider} from "@actions/workflow-parser/workflows/file-provider";
|
||||
import {fileIdentifier} from "@actions/workflow-parser/workflows/file-reference";
|
||||
import {Octokit} from "@octokit/rest";
|
||||
import path from "path";
|
||||
import {TTLCache} from "./utils/cache";
|
||||
import vscodeURI from "vscode-uri/lib/umd";
|
||||
|
||||
export function getFileProvider(
|
||||
client: Octokit | undefined,
|
||||
@@ -31,7 +31,10 @@ export function getFileProvider(
|
||||
throw new Error("Local file references are not supported with this configuration");
|
||||
}
|
||||
|
||||
const file = await readFile(path.join(workspace, ref.path));
|
||||
const workspaceURI = vscodeURI.URI.parse(workspace);
|
||||
const refURI = vscodeURI.Utils.joinPath(workspaceURI, ref.path);
|
||||
const file = await readFile(refURI.toString());
|
||||
|
||||
if (!file) {
|
||||
throw new Error(`File not found: ${ref.path}`);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@actions/languageservice",
|
||||
"version": "0.3.3",
|
||||
"version": "0.3.5",
|
||||
"description": "Language service for GitHub Actions",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
@@ -44,8 +44,8 @@
|
||||
"watch": "tsc --build tsconfig.build.json --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/expressions": "^0.3.3",
|
||||
"@actions/workflow-parser": "^0.3.3",
|
||||
"@actions/expressions": "^0.3.5",
|
||||
"@actions/workflow-parser": "^0.3.5",
|
||||
"vscode-languageserver-textdocument": "^1.0.7",
|
||||
"vscode-languageserver-types": "^3.17.2",
|
||||
"vscode-uri": "^3.0.7",
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
|
||||
"useWorkspaces": true,
|
||||
"version": "0.3.3"
|
||||
"version": "0.3.5"
|
||||
}
|
||||
|
||||
Generated
+9
-9
@@ -135,7 +135,7 @@
|
||||
},
|
||||
"expressions": {
|
||||
"name": "@actions/expressions",
|
||||
"version": "0.3.3",
|
||||
"version": "0.3.5",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.0.3",
|
||||
@@ -395,11 +395,11 @@
|
||||
},
|
||||
"languageserver": {
|
||||
"name": "@actions/languageserver",
|
||||
"version": "0.3.3",
|
||||
"version": "0.3.5",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/languageservice": "^0.3.3",
|
||||
"@actions/workflow-parser": "^0.3.3",
|
||||
"@actions/languageservice": "^0.3.5",
|
||||
"@actions/workflow-parser": "^0.3.5",
|
||||
"@octokit/rest": "^19.0.7",
|
||||
"@octokit/types": "^9.0.0",
|
||||
"vscode-languageserver": "^8.0.2",
|
||||
@@ -678,11 +678,11 @@
|
||||
},
|
||||
"languageservice": {
|
||||
"name": "@actions/languageservice",
|
||||
"version": "0.3.3",
|
||||
"version": "0.3.5",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/expressions": "^0.3.3",
|
||||
"@actions/workflow-parser": "^0.3.3",
|
||||
"@actions/expressions": "^0.3.5",
|
||||
"@actions/workflow-parser": "^0.3.5",
|
||||
"vscode-languageserver-textdocument": "^1.0.7",
|
||||
"vscode-languageserver-types": "^3.17.2",
|
||||
"vscode-uri": "^3.0.7",
|
||||
@@ -11720,10 +11720,10 @@
|
||||
},
|
||||
"workflow-parser": {
|
||||
"name": "@actions/workflow-parser",
|
||||
"version": "0.3.3",
|
||||
"version": "0.3.5",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/expressions": "^0.3.3",
|
||||
"@actions/expressions": "^0.3.5",
|
||||
"cronstrue": "^2.21.0",
|
||||
"yaml": "^2.0.0-8"
|
||||
},
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Release 0.3.5
|
||||
Executable
+32
@@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
# this script is used to generate release notes for a given release
|
||||
# first argument is the pull request id for the last release
|
||||
# the second is the new release number
|
||||
|
||||
# the script then grabs every pull request merged since that pull request
|
||||
# and outputs a string of release notes
|
||||
|
||||
# get the new release number
|
||||
NEW_RELEASE=$2
|
||||
|
||||
echo "Generating release notes for $NEW_RELEASE"
|
||||
|
||||
# get the last release pull request id
|
||||
LAST_RELEASE_PR=$1
|
||||
|
||||
|
||||
|
||||
#get when the last release was merged
|
||||
LAST_RELEASE_MERGED_AT=$(gh pr view $LAST_RELEASE_PR --repo actions/languageservices --json mergedAt | jq -r '.mergedAt')
|
||||
|
||||
CHANGELIST=$(gh pr list --repo actions/languageservices --base main --state merged --json title --search "merged:>$LAST_RELEASE_MERGED_AT -label:no-release")
|
||||
|
||||
# store the release notes in a variable so we can use it later
|
||||
|
||||
echo "Release $NEW_RELEASE" >> releasenotes.md
|
||||
|
||||
echo $CHANGELIST | jq -r '.[].title' | while read line; do
|
||||
echo " - $line" >> releasenotes.md
|
||||
done
|
||||
|
||||
echo " "
|
||||
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
VERSION=$(cat lerna.json | jq -r '.version')
|
||||
|
||||
MAJOR=$(echo $VERSION | cut -d. -f1)
|
||||
MINOR=$(echo $VERSION | cut -d. -f2)
|
||||
PATCH=$(echo $VERSION | cut -d. -f3)
|
||||
|
||||
if [ "$1" == "major" ]; then
|
||||
MAJOR=$((MAJOR+1))
|
||||
MINOR=0
|
||||
PATCH=0
|
||||
elif [ "$1" == "minor" ]; then
|
||||
MINOR=$((MINOR+1))
|
||||
PATCH=0
|
||||
elif [ "$1" == "patch" ]; then
|
||||
PATCH=$((PATCH+1))
|
||||
else
|
||||
echo "Invalid version type. Use 'major', 'minor' or 'patch'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
|
||||
echo $NEW_VERSION
|
||||
@@ -35,7 +35,7 @@ jobs:
|
||||
);
|
||||
```
|
||||
|
||||
`convertWorkflowTemplate` then takes that intermediate representation and converts it to a [`WorkflowTemplate`](./src/workflow-template.ts) object, which is a more convenient representation for working with workflows.
|
||||
`convertWorkflowTemplate` then takes that intermediate representation and converts it to a [`WorkflowTemplate`](./src/model/workflow-template.ts) object, which is a more convenient representation for working with workflows.
|
||||
|
||||
```typescript
|
||||
const workflowTemplate = await convertWorkflowTemplate(result.context, result.value);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@actions/workflow-parser",
|
||||
"version": "0.3.3",
|
||||
"version": "0.3.5",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"source": "./src/index.ts",
|
||||
@@ -43,7 +43,7 @@
|
||||
"watch": "tsc --build tsconfig.build.json --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/expressions": "^0.3.3",
|
||||
"@actions/expressions": "^0.3.5",
|
||||
"cronstrue": "^2.21.0",
|
||||
"yaml": "^2.0.0-8"
|
||||
},
|
||||
|
||||
@@ -577,7 +577,8 @@
|
||||
"mapping": {
|
||||
"properties": {
|
||||
"types": "merge-group-activity",
|
||||
"branches": "event-branches"
|
||||
"branches": "event-branches",
|
||||
"branches-ignore": "event-branches-ignore"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
+7
-2
@@ -73,8 +73,10 @@ on:
|
||||
- deleted
|
||||
merge_group:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
- master
|
||||
- main
|
||||
branches-ignore:
|
||||
- develop
|
||||
types:
|
||||
- checks_requested
|
||||
milestone:
|
||||
@@ -321,6 +323,9 @@ jobs:
|
||||
"master",
|
||||
"main"
|
||||
],
|
||||
"branches-ignore": [
|
||||
"develop"
|
||||
],
|
||||
"types": [
|
||||
"checks_requested"
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user