Compare commits

..

13 Commits

Author SHA1 Message Date
Ben De St Paer-Gotch ba76012970 Update README.md 2025-06-10 16:41:07 +01:00
Konrad Pabjan 4bc8754ffc Merge pull request #208 from actions/konradpabjan/add-new-release-workflow
Check dist/ / Check dist/ (push) Has been cancelled
Continuous Integration / TypeScript Tests (push) Has been cancelled
Lint Code Base / Lint Code Base (push) Has been cancelled
Add release action
2024-10-22 10:09:29 -04:00
Konrad Pabjan f4d851fab3 Simplify release workflow configuration 2024-10-22 09:28:52 -04:00
Konrad Pabjan fc8ba308da Create release-new-action-version.yml 2024-10-22 09:08:09 -04:00
Joel Ambass 3fc9aa365f Merge pull request #200 from actions/jcambass/2024-09-16/update-instructions
Use Release Published
2024-09-16 17:15:28 +02:00
Joel Ambass 2d5c4224f2 Use Release Published 2024-09-16 17:05:18 +02:00
Joel Ambass 4b1aa5c1cd Merge pull request #199 from actions/jcambass/2024-09-16/do-not-check-for-action-yml
Do not assume action.yml exists
2024-09-16 16:29:19 +02:00
Joel Ambass 2acc8d8fc9 Do not assume action.yml exists 2024-09-16 16:23:56 +02:00
Joel Ambass d34ce159aa Merge pull request #198 from actions/Jcambass-patch-1
Use newest Release in README
2024-09-16 15:49:38 +02:00
Joel Ambass d5420c2c97 Use newest Release in README 2024-09-16 15:46:12 +02:00
Joel Ambass 23606e825a Merge pull request #197 from actions/jcambass/2024-09-16/default-to-actions-token
Default to GITHUB_TOKEN
2024-09-16 15:43:51 +02:00
Joel Ambass 391942adf2 Default to GITHUB_TOKEN 2024-09-16 15:16:26 +02:00
Joel Ambass ff725e43e8 Merge pull request #190 from actions/fix_logging
Fix Logging
2024-09-03 17:38:42 +02:00
8 changed files with 48 additions and 53 deletions
@@ -0,0 +1,23 @@
name: Release new action version
on:
release:
types: [released]
env:
TAG_NAME: ${{ github.event.release.tag_name }}
permissions:
contents: write
jobs:
update_tag:
name: Update the major tag to include the ${{ 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.3.0
with:
source-tag: ${{ env.TAG_NAME }}
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
+3 -4
View File
@@ -1,10 +1,11 @@
# Package and publish the action when a new release is created
# Package and publish the action when a new release is published
# Since this is the publishing action itself, we can use the current checkout as the action
name: 'Publish Immutable Action Version'
on:
release:
types: [created]
types: [published]
permissions:
contents: read
id-token: write
packages: write
jobs:
@@ -15,5 +16,3 @@ jobs:
uses: actions/checkout@v4
- name: Publish Immutable Action Version
uses: ./
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
+20 -4
View File
@@ -37,7 +37,7 @@ name: "Publish Immutable Action Version"
on:
release:
types: [created]
types: [published]
jobs:
publish:
@@ -51,12 +51,28 @@ jobs:
uses: actions/checkout@v4
- name: Publish
id: publish
uses: actions/publish-immutable-action@0.0.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
uses: actions/publish-immutable-action@0.0.3
```
<!-- end usage -->
## Note
Thank you for your interest in this GitHub repo, however, right now we are not taking contributions.
We continue to focus our resources on strategic areas that help our customers be successful while making developers' lives easier. While GitHub Actions remains a key part of this vision, we are allocating resources towards other areas of Actions and are not taking contributions to this repository at this time. The GitHub public roadmap is the best place to follow along for any updates on features were working on and what stage theyre in.
We are taking the following steps to better direct requests related to GitHub Actions, including:
1. We will be directing questions and support requests to our [Community Discussions area](https://github.com/orgs/community/discussions/categories/actions)
2. High Priority bugs can be reported through Community Discussions or you can report these to our support team https://support.github.com/contact/bug-report.
3. Security Issues should be handled as per our [security.md](security.md)
We will still provide security updates for this project and fix major breaking changes during this time.
You are welcome to still raise bugs in this repo.
## License
The scripts and documentation in this project are released under the [MIT License](LICENSE).
-23
View File
@@ -24,12 +24,6 @@ describe('stageActionFiles', () => {
fs.rmSync(stagingDir, { recursive: true })
})
it('returns an error if no action.yml file is present', () => {
expect(() => fsHelper.stageActionFiles(sourceDir, stagingDir)).toThrow(
/^No action.yml or action.yaml file found in source repository/
)
})
it('copies all files (excluding the .git folder) to the staging directory', () => {
fs.writeFileSync(`${sourceDir}/action.yml`, fileContent)
@@ -50,23 +44,6 @@ describe('stageActionFiles', () => {
// .git folder is not copied
expect(fs.existsSync(`${stagingDir}/.git`)).toBe(false)
})
it('copies all files (excluding the .git folder) to the staging directory, even if action.yml is in a subdirectory', () => {
fs.mkdirSync(`${sourceDir}/my-sub-action`, { recursive: true })
fs.writeFileSync(`${sourceDir}/my-sub-action/action.yml`, fileContent)
fsHelper.stageActionFiles(sourceDir, stagingDir)
expect(fs.existsSync(`${stagingDir}/src/main.js`)).toBe(true)
expect(fs.existsSync(`${stagingDir}/src/other.js`)).toBe(true)
expect(fs.existsSync(`${stagingDir}/my-sub-action/action.yml`)).toBe(true)
})
it('accepts action.yaml as a valid action file as well as action.yml', () => {
fs.writeFileSync(`${sourceDir}/action.yaml`, fileContent)
fsHelper.stageActionFiles(sourceDir, stagingDir)
expect(fs.existsSync(`${stagingDir}/action.yaml`)).toBe(true)
})
})
describe('createArchives', () => {
+1
View File
@@ -9,6 +9,7 @@ branding:
inputs:
github-token:
description: 'The GitHub actions token used to authenticate with GitHub APIs'
default: ${{ github.token }}
outputs:
package-manifest-sha:
+1 -1
View File
@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="110" height="20" role="img" aria-label="Coverage: 97.1%"><title>Coverage: 97.1%</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="110" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="63" height="20" fill="#555"/><rect x="63" width="47" height="20" fill="#4c1"/><rect width="110" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="325" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="530">Coverage</text><text x="325" y="140" transform="scale(.1)" fill="#fff" textLength="530">Coverage</text><text aria-hidden="true" x="855" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="370">97.1%</text><text x="855" y="140" transform="scale(.1)" fill="#fff" textLength="370">97.1%</text></g></svg>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="116" height="20" role="img" aria-label="Coverage: 97.06%"><title>Coverage: 97.06%</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="116" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="63" height="20" fill="#555"/><rect x="63" width="53" height="20" fill="#4c1"/><rect width="116" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="325" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="530">Coverage</text><text x="325" y="140" transform="scale(.1)" fill="#fff" textLength="530">Coverage</text><text aria-hidden="true" x="885" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="430">97.06%</text><text x="885" y="140" transform="scale(.1)" fill="#fff" textLength="430">97.06%</text></g></svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Generated Vendored
-8
View File
@@ -106597,15 +106597,10 @@ function readFileContents(filePath) {
return fs.readFileSync(filePath);
}
// Copy actions files from sourceDir to targetDir, excluding the .git folder.
// Errors if the repo appears to not contain any action files, such as an action.yml file
function stageActionFiles(actionDir, targetDir) {
let actionYmlFound = false;
fs_extra_1.default.copySync(actionDir, targetDir, {
filter: (src) => {
const basename = path.basename(src);
if (basename === 'action.yml' || basename === 'action.yaml') {
actionYmlFound = true;
}
// Filter out the .git folder.
if (basename === '.git') {
return false;
@@ -106613,9 +106608,6 @@ function stageActionFiles(actionDir, targetDir) {
return true;
}
});
if (!actionYmlFound) {
throw new Error(`No action.yml or action.yaml file found in source repository`);
}
}
// Ensure the correct SHA is checked out for the tag by inspecting the git metadata in the workspace
// and comparing it to the information actions provided us.
-13
View File
@@ -91,18 +91,11 @@ export function readFileContents(filePath: string): Buffer {
}
// Copy actions files from sourceDir to targetDir, excluding the .git folder.
// Errors if the repo appears to not contain any action files, such as an action.yml file
export function stageActionFiles(actionDir: string, targetDir: string): void {
let actionYmlFound = false
fsExtra.copySync(actionDir, targetDir, {
filter: (src: string) => {
const basename = path.basename(src)
if (basename === 'action.yml' || basename === 'action.yaml') {
actionYmlFound = true
}
// Filter out the .git folder.
if (basename === '.git') {
return false
@@ -111,12 +104,6 @@ export function stageActionFiles(actionDir: string, targetDir: string): void {
return true
}
})
if (!actionYmlFound) {
throw new Error(
`No action.yml or action.yaml file found in source repository`
)
}
}
// Ensure the correct SHA is checked out for the tag by inspecting the git metadata in the workspace