Skip to content

Commit

Permalink
Chore: some preparation
Browse files Browse the repository at this point in the history
  • Loading branch information
Lruihao committed Jan 16, 2025
1 parent 56472d5 commit bde47de
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 87 deletions.
7 changes: 0 additions & 7 deletions CODEOWNERS

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright GitHub
Copyright 2025 Lruihao (https://lruihao.cn)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
108 changes: 42 additions & 66 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,47 @@
# Create a GitHub Action Using TypeScript
# action-component-list | FixIt

[![GitHub Super-Linter](https://github.com/actions/typescript-action/actions/workflows/linter.yml/badge.svg)](https://github.com/super-linter/super-linter)
![CI](https://github.com/actions/typescript-action/actions/workflows/ci.yml/badge.svg)
[![Check dist/](https://github.com/actions/typescript-action/actions/workflows/check-dist.yml/badge.svg)](https://github.com/actions/typescript-action/actions/workflows/check-dist.yml)
[![CodeQL](https://github.com/actions/typescript-action/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/actions/typescript-action/actions/workflows/codeql-analysis.yml)
[![GitHub Super-Linter](https://github.com/hugo-fixit/action-component-list/actions/workflows/linter.yml/badge.svg)](https://github.com/super-linter/super-linter)
![CI](https://github.com/hugo-fixit/action-component-list/actions/workflows/ci.yml/badge.svg)
[![Check dist/](https://github.com/hugo-fixit/action-component-list/actions/workflows/check-dist.yml/badge.svg)](https://github.com/hugo-fixit/action-component-list/actions/workflows/check-dist.yml)
[![CodeQL](https://github.com/hugo-fixit/action-component-list/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/hugo-fixit/action-component-list/actions/workflows/codeql-analysis.yml)
[![Coverage](./badges/coverage.svg)](./badges/coverage.svg)

Use this template to bootstrap the creation of a TypeScript action. :rocket:
This is a GitHub action to generate a list of all hugo-fixit theme components.

This template includes compilation support, tests, a validation workflow,
publishing, and versioning guidance.
## Usage

You can reference different stable versions of this action. For more
information, see
[Versioning](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md)
in the GitHub Actions toolkit.

If you are new, there's also a simpler introduction in the
[Hello world JavaScript action repository](https://github.com/actions/hello-world-javascript-action).
To include the action in a workflow in another repository, you can use the
`uses` syntax with the `@` symbol to reference a specific branch, tag, or commit
hash.

```yaml
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4

## Create Your Own Action
- name: Test Local Action
id: test-action
uses: hugo-fixit/action-component-list@v1 # Commit with the `v1` tag
with:
milliseconds: 1000

To create your own action, you can use this repository as a template! Just
follow the below instructions:
- name: Print Output
id: output
run: echo "${{ steps.test-action.outputs.time }}"
```
1. Click the **Use this template** button at the top of the repository
1. Select **Create a new repository**
1. Select an owner and name for your new repository
1. Click **Create repository**
1. Clone your new repository
## Development Setup
> [!IMPORTANT]
>
> Make sure to remove or update the [`CODEOWNERS`](./CODEOWNERS) file! For
> details on how to use this file, see
> [About code owners](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners).
<details>
<summary>Click to view.</summary>
## Initial Setup
### Initial Setup
After you've cloned the repository to your local machine or codespace, you'll
need to perform some initial setup steps before you can develop your action.
Expand Down Expand Up @@ -71,16 +81,7 @@ need to perform some initial setup steps before you can develop your action.
...
```

## Update the Action Metadata

The [`action.yml`](action.yml) file defines metadata about your action, such as
input(s) and output(s). For details about this file, see
[Metadata syntax for GitHub Actions](https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions).

When you copy this repository, update `action.yml` with the name, description,
inputs, and outputs for your action.

## Update the Action Code
### Update the Action Code

The [`src/`](./src/) directory is the heart of your action! This contains the
source code that will be run when your action is invoked. You can replace the
Expand Down Expand Up @@ -162,7 +163,7 @@ So, what are you waiting for? Go ahead and start customizing your action!

```bash
git add .
git commit -m "My first action is ready!"
git commit -m "Feat: add new action code"
```

7. Push them to your repository
Expand All @@ -180,7 +181,7 @@ For information about versioning your action, see
[Versioning](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md)
in the GitHub Actions toolkit.

## Validate the Action
### Validate the Action

You can now validate the action by referencing it in a workflow file. For
example, [`ci.yml`](./.github/workflows/ci.yml) demonstrates how to reference an
Expand All @@ -204,37 +205,10 @@ steps:
```

For example workflow runs, check out the
[Actions tab](https://github.com/actions/typescript-action/actions)! :rocket:
[Actions tab](https://github.com/hugo-fixit/action-component-list/actions)!
:rocket:

## Usage

After testing, you can create version tag(s) that developers can use to
reference different stable versions of your action. For more information, see
[Versioning](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md)
in the GitHub Actions toolkit.

To include the action in a workflow in another repository, you can use the
`uses` syntax with the `@` symbol to reference a specific branch, tag, or commit
hash.

```yaml
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
- name: Test Local Action
id: test-action
uses: actions/typescript-action@v1 # Commit with the `v1` tag
with:
milliseconds: 1000
- name: Print Output
id: output
run: echo "${{ steps.test-action.outputs.time }}"
```

## Publishing a New Release
### Publishing a New Release

This project includes a helper script, [`script/release`](./script/release)
designed to streamline the process of tagging and pushing new releases for
Expand All @@ -260,3 +234,5 @@ following steps:
commits, tags and branches to the remote repository. From here, you will need
to create a new release in GitHub so users can easily reference the new tags
in their workflows.

</details>
13 changes: 5 additions & 8 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
name: The name of your action here
description: Provide a description here
author: Your name or organization here
name: Hugo FixIt Component List Workflow
description: Generate a list of all hugo-fixit theme components.
author: Lruihao

# Add your action's branding here. This will appear on the GitHub Marketplace.
branding:
icon: heart
color: red
icon: list
color: blue

# Define your inputs here.
inputs:
milliseconds:
description: Your input description here
required: true
default: '1000'

# Define your outputs here.
outputs:
time:
description: Your output description here
Expand Down
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
{
"name": "typescript-action",
"description": "GitHub Actions TypeScript template",
"name": "@hugo-fixit/action-component-list",
"description": "Generate a list of all hugo-fixit theme components.",
"version": "0.0.0",
"author": "",
"type": "module",
"private": true,
"homepage": "https://github.com/actions/typescript-action",
"homepage": "https://github.com/hugo-fixit/action-component-list",
"repository": {
"type": "git",
"url": "git+https://github.com/actions/typescript-action.git"
"url": "git+https://github.com/hugo-fixit/action-component-list.git"
},
"bugs": {
"url": "https://github.com/actions/typescript-action/issues"
"url": "https://github.com/hugo-fixit/action-component-list/issues"
},
"keywords": [
"Hugo",
"FixIt",
"actions"
],
"exports": {
Expand Down

0 comments on commit bde47de

Please sign in to comment.