Compare commits

...

18 Commits

Author SHA1 Message Date
Jess Bees
eaf36f48c9 Merge pull request #24 from actions/decouple-telemetry
Decouple telemetry API call from main action
2022-03-31 12:34:24 -04:00
Jess Bees
01f6ae5af2 Recompile action after pulling in PR suggestions 2022-03-31 12:05:36 -04:00
Jess Bees
82cb77089c Update action.yml
Co-authored-by: James M. Greene <JamesMGreene@github.com>
2022-03-31 11:47:49 -04:00
Jess Bees
ad36b7023a Don't bother converting action input to string
This has been an established pattern with Actions for a long time; we don't have to worry about it changing.

Co-authored-by: James M. Greene <JamesMGreene@github.com>
2022-03-31 11:47:33 -04:00
Jess Bees
32b8b86ff0 Support existing behavior of this action 2022-03-29 15:08:35 -04:00
Jess Bees
a598b2af14 Correctly test for boolean input's truthiness
It gets cast to a string! Eep!
2022-03-29 09:45:18 -04:00
Jess Bees
f511fa4665 Merge branch 'main' into decouple-telemetry 2022-03-29 09:05:35 -04:00
Yoann Chaudet
0e157789db Merge pull request #27 from actions/increase-default-query-interval
Increase default query interval and fix time exceed bug
2022-03-28 12:38:22 -07:00
yimysty
12940a5b99 fix the timeout not honor bug 2022-03-28 12:32:59 -07:00
yimysty
6afc4f2884 slow query seconds 2022-03-28 12:28:46 -07:00
Mingzi
a68b5a4ae1 Merge pull request #26 from actions/parsing-number
Parse correct timeout
2022-03-28 11:21:14 -07:00
yimysty
171a8a05dd update number parsing 2022-03-28 11:19:50 -07:00
Jess Bees
7a1dc4e394 update dist files 2022-03-23 14:56:28 -04:00
Jess Bees
92f6725bee Only emit telemetry when the emit_telemetry input is truthy 2022-03-23 14:40:57 -04:00
Jess Bees
e1279a88ef Don't call the telemetry pre-hook entrypoint 2022-03-23 14:22:16 -04:00
Mingzi
479e82243a Merge pull request #17 from paper-spa/main
Add release action
2022-02-07 13:42:46 -08:00
Mingzi
243ed8c2df Merge pull request #1 from paper-spa/add-release-plan
Add release action
2022-02-07 12:30:28 -08:00
yimysty
c2e0577d92 add all 2022-02-07 12:27:36 -08:00
10 changed files with 122 additions and 31 deletions

38
.github/release-drafter.yml vendored Normal file
View File

@@ -0,0 +1,38 @@
---
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
template: |
# Changelog
$CHANGES
See details of [all code changes](https://github.com/actions/jekyll-build-pages/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION) since previous release
categories:
- title: '🚀 Features'
labels:
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '🧰 Maintenance'
labels:
- 'infrastructure'
- 'automation'
- 'documentation'
- title: '🏎 Performance'
label: 'performance'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
version-resolver:
major:
labels:
- 'type: breaking'
minor:
labels:
- 'type: enhancement'
patch:
labels:
- 'type: bug'
- 'type: maintenance'
- 'type: documentation'
default: patch

View File

@@ -0,0 +1,28 @@
name: Release new action version
on:
release:
types: [edited]
workflow_dispatch:
inputs:
TAG_NAME:
description: 'Tag name that the major tag will point to'
required: true
env:
TAG_NAME: ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }}
permissions:
contents: write
jobs:
update_tag:
name: Update the major tag to include the ${{ github.event.inputs.TAG_NAME || github.event.release.tag_name }} changes
environment:
name: releaseNewActionVersion
runs-on: ubuntu-latest
steps:
- name: Update the ${{ env.TAG_NAME }} tag
id: update-major-tag
uses: actions/publish-action@v0.1.0
with:
source-tag: ${{ env.TAG_NAME }}
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}

View File

@@ -19,6 +19,10 @@ jobs:
- name: Install dependencies
run: npm install
- name: Run tests
run: npm run test
# Drafts your next Release notes as Pull Requests are merged into "main"
- uses: release-drafter/release-drafter@v5
if: github.ref_name == 'main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -3,8 +3,10 @@ description: 'A GitHub Action to deploy an artifact to GitHub Pages'
runs:
using: 'node16'
main: 'dist/index.js'
pre: 'pre/index.js'
inputs:
emit_telemetry:
description: 'Should this action only emit build telemetry instead of deploying the build artifact?'
required: false
token:
description: 'GitHub token'
default: ${{ github.token }}
@@ -20,7 +22,7 @@ inputs:
reporting_interval:
description: 'Time in milliseconds between two deployment status report (default: 1 second)'
required: false
default: "1000"
default: "5000"
outputs:
page_url:
description: 'URL to deployed Github Pages'

27
dist/index.js vendored
View File

@@ -7125,9 +7125,9 @@ class Deployment {
this.deploymentInfo["status_url"] :
`https://api.github.com/repos/${this.repositoryNwo}/pages/deployment/status/${process.env['GITHUB_SHA']}`
core.setOutput('page_url', this.deploymentInfo != null ? this.deploymentInfo["page_url"] : "")
const timeout = core.getInput('timeout')
const timeout = Number(core.getInput('timeout'))
const reportingInterval = Number(core.getInput('reporting_interval'))
const maxErrorCount = core.getInput('error_count')
const maxErrorCount = Number(core.getInput('error_count'))
var startTime = Date.now()
var errorCount = 0
@@ -7182,12 +7182,13 @@ class Deployment {
core.setFailed('Failed with status code: ' + res.status)
break
}
}
// Handle timeout
if (Date.now() - startTime >= timeout) {
core.info('Timeout reached, aborting!')
core.setFailed('Timeout reached, aborting!')
return
// Handle timeout
if (Date.now() - startTime >= timeout) {
core.info('Timeout reached, aborting!')
core.setFailed('Timeout reached, aborting!')
return
}
}
} catch (error) {
core.setFailed(error)
@@ -7472,7 +7473,15 @@ process.on('SIGINT', cancelHandler)
process.on('SIGTERM', cancelHandler)
// Main
main().then(() => __nccwpck_require__(9557))
const emitTelemetry = core.getInput("emit_telemetry")
if (emitTelemetry === "true") {
__nccwpck_require__(9557)
} else if (emitTelemetry === "false") {
main()
} else {
// If emit_telemetry is not set, that indicates an older version of the dynamic workflow that doesn't separate telemetry from deployment
main().then(() => __nccwpck_require__(9557))
}
})();

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@@ -7125,9 +7125,9 @@ class Deployment {
this.deploymentInfo["status_url"] :
`https://api.github.com/repos/${this.repositoryNwo}/pages/deployment/status/${process.env['GITHUB_SHA']}`
core.setOutput('page_url', this.deploymentInfo != null ? this.deploymentInfo["page_url"] : "")
const timeout = core.getInput('timeout')
const timeout = Number(core.getInput('timeout'))
const reportingInterval = Number(core.getInput('reporting_interval'))
const maxErrorCount = core.getInput('error_count')
const maxErrorCount = Number(core.getInput('error_count'))
var startTime = Date.now()
var errorCount = 0
@@ -7182,12 +7182,13 @@ class Deployment {
core.setFailed('Failed with status code: ' + res.status)
break
}
}
// Handle timeout
if (Date.now() - startTime >= timeout) {
core.info('Timeout reached, aborting!')
core.setFailed('Timeout reached, aborting!')
return
// Handle timeout
if (Date.now() - startTime >= timeout) {
core.info('Timeout reached, aborting!')
core.setFailed('Timeout reached, aborting!')
return
}
}
} catch (error) {
core.setFailed(error)

File diff suppressed because one or more lines are too long

View File

@@ -81,9 +81,9 @@ class Deployment {
this.deploymentInfo["status_url"] :
`https://api.github.com/repos/${this.repositoryNwo}/pages/deployment/status/${process.env['GITHUB_SHA']}`
core.setOutput('page_url', this.deploymentInfo != null ? this.deploymentInfo["page_url"] : "")
const timeout = core.getInput('timeout')
const timeout = Number(core.getInput('timeout'))
const reportingInterval = Number(core.getInput('reporting_interval'))
const maxErrorCount = core.getInput('error_count')
const maxErrorCount = Number(core.getInput('error_count'))
var startTime = Date.now()
var errorCount = 0
@@ -138,12 +138,13 @@ class Deployment {
core.setFailed('Failed with status code: ' + res.status)
break
}
}
// Handle timeout
if (Date.now() - startTime >= timeout) {
core.info('Timeout reached, aborting!')
core.setFailed('Timeout reached, aborting!')
return
// Handle timeout
if (Date.now() - startTime >= timeout) {
core.info('Timeout reached, aborting!')
core.setFailed('Timeout reached, aborting!')
return
}
}
} catch (error) {
core.setFailed(error)

View File

@@ -52,4 +52,12 @@ process.on('SIGINT', cancelHandler)
process.on('SIGTERM', cancelHandler)
// Main
main().then(() => require('./pre'))
const emitTelemetry = core.getInput("emit_telemetry")
if (emitTelemetry === "true") {
require('./pre')
} else if (emitTelemetry === "false") {
main()
} else {
// If emit_telemetry is not set, that indicates an older version of the dynamic workflow that doesn't separate telemetry from deployment
main().then(() => require('./pre'))
}