mirror of
https://github.com/AnandChowdhary/package-version-action.git
synced 2025-12-06 07:48:12 +08:00
✨ Add date/hash outputs
This commit is contained in:
16
README.md
16
README.md
@@ -35,13 +35,15 @@ jobs:
|
||||
|
||||
### Outputs
|
||||
|
||||
| Output name | Description | Example value |
|
||||
| ---------------------------- | ------------------------ | ------------------ |
|
||||
| `package-version` | Latest release version | v2.23.1 |
|
||||
| `package-version-timestamp` | Version + unix timestamp | v2.23.1-1609693587 |
|
||||
| `short-hash` | Last commit hash | 1abc9c3 |
|
||||
| `package-version-short-hash` | Version + commit hash | v2.23.1-1abc9c3 |
|
||||
| `package-version-random` | Version + random string | v2.23.1-238a32ef21 |
|
||||
| Output name | Description | Example value |
|
||||
| ---------------------------- | -------------------------- | ----------------------------------- |
|
||||
| `package-version` | Latest release version | v2.23.1 |
|
||||
| `package-version-timestamp` | Version + unix timestamp | v2.23.1-1609693587 |
|
||||
| `short-hash` | Last commit hash | 1abc9c3 |
|
||||
| `package-version-short-hash` | Version + commit hash | v2.23.1-1abc9c3 |
|
||||
| `package-version-random` | Version + random string | v2.23.1-238a32ef21 |
|
||||
| `date-hash` | Date + commit hash | 2020-12-29-238a32ef21 |
|
||||
| `date-time-hash` | ISO datetime + commit hash | 2020-12-29T09:35:34.759Z-238a32ef21 |
|
||||
|
||||
## 📄 License
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@ export const run = async () => {
|
||||
);
|
||||
const hash = execSync("git rev-parse --short HEAD", { encoding: "utf8" }).trim();
|
||||
setOutput("short-hash", hash);
|
||||
setOutput("date-short-hash", `${new Date().toISOString().substr(0, 10)}-${hash}`);
|
||||
setOutput("date-time-short-hash", `${new Date().toISOString()}-${hash}`);
|
||||
setOutput("package-version-short-hash", `${lastVersion}-${hash}`);
|
||||
setOutput(
|
||||
"package-version-random",
|
||||
|
||||
Reference in New Issue
Block a user