Skip to content

Commit 58fcca1

Browse files
authored
update README (#5)
1 parent ae29f5d commit 58fcca1

File tree

3 files changed

+51
-107
lines changed

3 files changed

+51
-107
lines changed

.github/workflows/build.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ jobs:
2020
- name: Install Dependencies
2121
run: npm ci
2222

23-
- name: Check Formatting
24-
run: |
25-
npm run format
26-
git diff && git diff-index --quiet --exit-code HEAD
27-
2823
- name: Check Lint
2924
run: npm run lint
3025

LICENSE

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
1-
This is free and unencumbered software released into the public domain.
1+
MIT License
22

3-
Anyone is free to copy, modify, publish, use, compile, sell, or
4-
distribute this software, either in source code form or as a compiled
5-
binary, for any purpose, commercial or non-commercial, and by any
6-
means.
3+
Copyright (c) 2024 Aayush Shah
74

8-
In jurisdictions that recognize copyright laws, the author or authors
9-
of this software dedicate any and all copyright interest in the
10-
software to the public domain. We make this dedication for the benefit
11-
of the public at large and to the detriment of our heirs and
12-
successors. We intend this dedication to be an overt act of
13-
relinquishment in perpetuity of all present and future rights to this
14-
software under copyright law.
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
1511

16-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19-
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20-
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21-
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22-
OTHER DEALINGS IN THE SOFTWARE.
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
2314

24-
For more information, please refer to <http://unlicense.org/>
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 34 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,53 @@
1-
<!-- TODO: Replace the content of this file with the new project description. -->
1+
# Delete Blacksmith Cache Action
22

3-
# Action Starter
4-
5-
A minimalist template for starting a new [GitHub Action](https://github.com/features/actions) project.
6-
7-
This template provides a basic GitHub Action project containing a sample [JavaScript action](https://docs.github.com/en/actions/sharing-automations/creating-actions/creating-a-javascript-action) written in [TypeScript](https://www.typescriptlang.org/), with built-in support for formatting, linting, testing, and continuous integration.
8-
9-
## Key Features
10-
11-
- Minimal GitHub Action project written in TypeScript with [ESM](https://nodejs.org/api/esm.html) support.
12-
- Uses [Yarn](https://yarnpkg.com/) as the package manager with [Plug'n'Play](https://yarnpkg.com/features/pnp) support.
13-
- Supports formatting with [Prettier](https://prettier.io/), linting with [ESLint](https://eslint.org/), and testing with [Jest](https://jestjs.io/).
14-
- Preconfigured workflows for [Dependabot](https://docs.github.com/en/code-security/dependabot) and [GitHub Actions](https://github.com/features/actions).
3+
A GitHub Action to delete caches from Blacksmith's cache storage. This action allows you to delete either a specific cache version or all versions of a cache key.
154

165
## Usage
176

18-
This guide explains how to use this template to start a new GitHub Action project, from creation to release.
19-
20-
### Create a New Project
21-
22-
Follow [this link](https://github.com/new?template_name=action-starter&template_owner=threeal) to create a new project based on this template. For more information about creating a repository from a template on GitHub, refer to [this documentation](https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template).
23-
24-
Alternatively, you can clone this repository locally to begin using this template.
25-
26-
### Choose a License
27-
28-
By default, this template is [unlicensed](https://unlicense.org/). Before modifying this template, replace the [`LICENSE`](./LICENSE) file with the license to be used by the new project. For more information about licensing a repository, refer to [this documentation](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository).
29-
30-
Alternatively, you can remove the `LICENSE` file or leave it as-is to keep the new project unlicensed.
31-
32-
### Update Project Information
33-
34-
To replace the sample information in this template with details about your new project, complete the following steps:
35-
36-
- Replace the content of this [`README.md`](./README.md) file with a description of the new project. For more information on adding READMEs to a project, refer to [this documentation](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-readmes).
37-
- Modify the action metadata in the [`action.yml`](./action.yml) file according to the new project specifications. For more details on the action metadata, refer to [this documentation](https://docs.github.com/en/actions/sharing-automations/creating-actions/metadata-syntax-for-github-actions).
38-
39-
> Note: You can also search for `TODO` comments for a list of information that needs to be replaced.
40-
41-
### Set Up Tools
42-
43-
It is recommended to use [nvm](https://github.com/nvm-sh/nvm) to manage the Node.js version in the project. By default, this template uses the Node.js version specified in the [`.nvmrc`](./.nvmrc) file. Use the following command to install and use the correct Node.js version with nvm:
44-
45-
```sh
46-
nvm install
47-
```
48-
49-
This template uses [Yarn](https://yarnpkg.com/) with [Plug'n'Play](https://yarnpkg.com/features/pnp) support as the package manager. If Yarn is not yet enabled, run the following command:
50-
51-
```sh
52-
corepack enable yarn
53-
```
54-
55-
Then, install the project dependencies with:
56-
57-
```sh
58-
yarn install
7+
```yaml
8+
- name: Delete Cache
9+
uses: useblacksmith/cache-delete@v1
10+
with:
11+
key: Linux-composer-ecf6e2e236589e4d34ba89662b6bc2afe8e15237cd19a13df9dc0cb599ff4826
12+
version: v213asda2cf # Optional: specific version to delete
5913
```
6014
61-
For more information on Yarn, such as adding dependencies or running tools, refer to [this documentation](https://yarnpkg.com/getting-started).
15+
## Inputs
6216
63-
### Developing the Action
17+
| Input | Description | Required |
18+
| --------- | --------------------------------------- | -------- |
19+
| `key` | The cache key to delete | Yes |
20+
| `version` | Specific version of the cache to delete | No |
6421

65-
Write the logic for the action in the [`src/main.ts`](./src/main.ts) file according to the project requirements. If you're new to [TypeScript](https://www.typescriptlang.org/), refer to [this documentation](https://www.typescriptlang.org/docs/) for guidance.
22+
## Examples
6623

67-
If the action will support pre- and post-steps, additional files like `src/pre.ts` and `src/post.ts` can be added. Just make sure to update the Rollup configuration in the [`rollup.config.js`](./rollup.config.js) file and the action metadata in the [`action.yml`](./action.yml) file.
24+
### Delete All Versions of a Cache
6825

69-
Once the code is written, format it with:
70-
71-
```sh
72-
yarn format
73-
```
74-
75-
Then, check linting with:
76-
77-
```sh
78-
yarn lint
26+
```yaml
27+
- name: Delete All Cache Versions
28+
uses: useblacksmith/cache-delete@v1
29+
with:
30+
key: npm-cache
7931
```
8032

81-
Lastly, build and bundle the action files with:
33+
### Delete a Specific Cache Version
8234

83-
```sh
84-
yarn build
35+
```yaml
36+
- name: Delete Specific Cache Version
37+
uses: useblacksmith/cache-delete@v1
38+
with:
39+
key: npm-cache
40+
version: v1.0
8541
```
8642

87-
### Testing the Action
43+
## Error Handling
8844

89-
Test files in this template are named `*.test.ts` and typically correspond to the source files being tested. This template uses [Jest](https://jestjs.io/) as the testing framework. For more information on testing with Jest, refer to [this documentation](https://jestjs.io/docs/getting-started).
90-
91-
After creating your test files, run tests with:
92-
93-
```sh
94-
yarn test
95-
```
45+
The action will:
9646

97-
Additionally, you can test the action by running it directly from the GitHub workflow as specified in the [`.github/workflows/test.yaml`](./.github/workflows/test.yaml) file.
47+
- Fail if the cache deletion request fails (non-404 error)
48+
- Log a message if the cache is not found (404)
49+
- Successfully complete if the cache is deleted
9850

99-
### Release the Action
51+
## License
10052

101-
When the project is complete, release and publish it from the project repository page on GitHub. For more information on releasing a project, refer to [this documentation](https://docs.github.com/en/repositories/releasing-projects-on-github/about-releases). For more information on publishing GitHub actions, refer to [this documentation](https://docs.github.com/en/actions/sharing-automations/creating-actions/publishing-actions-in-github-marketplace).
53+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

0 commit comments

Comments
 (0)