Can u add time(time taken to consume that content) field beside the videos, articles, etc. So, that we can add time after consuming that content from that article/video/etc. These timestamps will be useful for us in knowing how much time we spent on that content and others can know how much time it will take approximately to complete that topic. #977
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Label Issue | |
on: | |
issues: | |
types: [ opened, edited ] | |
jobs: | |
label-topic-change-issue: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Add Labels To Issue | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const issue = context.payload.issue; | |
const roadmapUrl = issue.body.match(/https?:\/\/roadmap.sh\/[^ ]+/); | |
// if the issue is labeled as a topic-change, add the roadmap slug as a label | |
if (issue.labels.some(label => label.name === 'topic-change')) { | |
if (roadmapUrl) { | |
const roadmapSlug = new URL(roadmapUrl[0]).pathname.replace(/\//, ''); | |
github.rest.issues.addLabels({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: issue.number, | |
labels: [roadmapSlug] | |
}); | |
} | |
// Close the issue if it has no roadmap URL | |
if (!roadmapUrl) { | |
github.rest.issues.update({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number: issue.number, | |
state: 'closed' | |
}); | |
} | |
} |