diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index de2de1c..ca2cd7e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,6 +6,28 @@ on: - next - beta jobs: + pr: + name: Create Release PR + runs-on: ubuntu-latest + steps: + - name: Check For PR + env: + REF: ${{ env.GITHUB_BASE_REF }} + BASE: master + GITHUB_TOKEN: ${{ secrets.BOT_GIT_TOKEN }} + run: | + BRANCH=${GITHUB_REF##*/} + [[ "$BRANCH" == "$BASE" ]] && exit 0; + if [[ "$BRANCH" == "alpha" ]]; then + BASE="beta" + fi + echo "Check If PR exists for $BRANCH --> $BASE" + if [[ "$(gh pr list -R "$GITHUB_REPOSITORY" --base "$BASE" --state open --label "Release $BRANCH")" == "" ]]; then + echo "Creating PR $BRANCH --> $BASE" + RESULT=$(gh api repos/"${GITHUB_REPOSITORY}"/pulls -F head="$BRANCH" -F base="$BASE" -F title="Release $BRANCH" -F body="This PR was generated automatically. Merging it will transition $BRANCH into ${BASE}.") + PR_NUM=$(echo $RESULT | jq -r '.number') + printf '{"labels": ["Release %s"]}' $BRANCH | gh api repos/"${GITHUB_REPOSITORY}"/issues/"${PR_NUM}"/labels --input - + fi release: name: Release runs-on: ubuntu-latest diff --git a/README.md b/README.md index 445fa8e..01c2cbf 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: bradennapier/eslint-plus-action@v3.4.1 + - uses: bradennapier/eslint-plus-action@v3.4.2-beta.1 ``` ## Features @@ -131,7 +131,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: bradennapier/eslint-plus-action@v3.4.1 + - uses: bradennapier/eslint-plus-action@v3.4.2-beta.1 ``` ## Examples @@ -149,7 +149,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: bradennapier/eslint-plus-action@v3.4.1 + - uses: bradennapier/eslint-plus-action@v3.4.2-beta.1 ``` ### Environment Variables @@ -162,7 +162,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: bradennapier/eslint-plus-action@v3.4.1 + - uses: bradennapier/eslint-plus-action@v3.4.2-beta.1 env: NPM_TOKEN: ${{secrets.NPM_TOKEN}} ``` @@ -175,7 +175,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: bradennapier/eslint-plus-action@v3.4.1 + - uses: bradennapier/eslint-plus-action@v3.4.2-beta.1 env: NPM_TOKEN: ${{secrets.NPM_TOKEN}} with: diff --git a/lib/utils.js b/lib/utils.js index 8e6dcc6..c00365a 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -125,6 +125,7 @@ function processLintResults(engine, report, data) { else { rule.annotations.push(annotation); } + console.warn('ESLint Annotation: ', annotation); annotations.push(annotation); } } diff --git a/package.json b/package.json index 9ddcd32..6de9a8a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "typescript-action", - "version": "3.4.1", + "version": "3.4.2-beta.1", "private": true, "description": "TypeScript template action", "main": "lib/run.js", diff --git a/src/utils.ts b/src/utils.ts index 5f4147e..3d5ae82 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -200,6 +200,8 @@ export function processLintResults( rule.annotations.push(annotation); } + console.warn('ESLint Annotation: ', annotation); + annotations.push(annotation); } }