Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 37 additions & 11 deletions .github/workflows/add-update-label-weekly.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,45 @@
name: Schedule Sunday 0700
name: Add Update Label Weekly - ATO

# Associated configuration files for this workflow:
# `github-actions/workflow-configs/add-update-label-weekly-config.yml`
# `github-actions/workflow-configs/templates/add-update-instructions-template.md`
# Customization notes:
# Runs Wed 2200 UTC, exc. July and December.
# 2200 UTC is 3:00 PM Pacific during daylight saving (PDT) and 2:00 PM Pacific outside it (PST):
# GitHub cron is always UTC and does not follow DST, so the local time shifts by an hour on
# 1 Nov 2026 and back on 8 Mar 2027. Change to '0 23' if 3:00 PM PST matters more than 3:00 PM PDT.
# ⮡ You can compose a schedule here: https://crontab.cronhub.io/

on:
schedule:
- cron: '0 7 * * 0'
- cron: '0 22 * 1-6,8-11 3'
workflow_dispatch:
inputs:
dry-run:
description: 'Run in dry-run mode to preview changes: will not update labels or comments.'
type: boolean
default: true

permissions:
contents: read

jobs:
Add-Update-Label-to-Issues-Weekly:
Add-Update-Label-Weekly:
runs-on: ubuntu-latest
if: github.repository == 'hackforla/devops'
steps:
- uses: actions/checkout@v4
- uses: actions/github-script@v7
env:
IN_PROGRESS_COLUMN_ID: ${{ secrets.IN_PROGRESS_COLUMN_ID }}
- name: Generate token from GitHub App
id: generate-app-token
uses: actions/create-github-app-token@v3
with:
app-id: ${{ secrets.HFLA_GRAPHQL_APP_ID }}
private-key: ${{ secrets.HFLA_GRAPHQL_APP_PRIVATE_KEY }}

- name: Checkout repository
uses: actions/checkout@v6

- name: Run workflow
uses: hackforla/automate-the-org/gha-add-update-label-weekly@v1
with:
script: |
const { IN_PROGRESS_COLUMN_ID } = process.env;
const script = require('./github-actions/trigger-schedule/add-update-label-weekly/add-label.js');
script({ g: github, c: context }, IN_PROGRESS_COLUMN_ID);
github-token: ${{ steps.generate-app-token.outputs.token }}
dry-run: ${{ github.event_name == 'schedule' && 'false' || github.event.inputs.dry-run || 'true' }}
208 changes: 208 additions & 0 deletions github-actions/workflow-configs/add-update-label-weekly-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
# "Add Update Label Weekly" workflow configuration file
# File installed at: `github-actions/workflow-configs/add-update-label-weekly-config.yml`

# ==============================================================================
# IMPORTANT NOTES
# ==============================================================================
#
# 1. The configuration options are given as "key: value" pairs.
# a. Customize the "values" below for your project's needs.
# b. DO NOT EDIT "keys" as this may break the automation.
# c. DO NOT CHANGE indentation, spacing, or formatting for same reason.
# 2. Text values must match the EXACT text used in your project repo.
# 3. The default values will apply if not edited, and the workflow will attempt
# to run with those defaults. It is recommended to review and edit all values.



# ==============================================================================
# Opt-in for future features
# ==============================================================================
#
# If you would like to opt-in for future features when and if they are added to
# this workflow, uncomment this field and enter 'true'. If you do not, enter
# 'false' and/or keep this variable commented out.

# optInFutureFeatures: true



# ==============================================================================
# Labels and label placeholders used by this workflow
# ==============================================================================
#
# The `required` section lists label placeholder keys, which are identifiers
# used in the workflow to reference GitHub repo labels. These placeholder label
# keys are essential for the workflow to function and must be mapped to the
# **actual label names** that exist in your project. Do not change the label
# keys, however **do edit** the name values (in quotes) to match your project's
# labels. The `required` labels are:
#
# statusUpdated: "label for issues considered current"
# statusInactive1: "label for issues needing updates"
# statusInactive2: "label for issues considered inactive"
# statusHelpWanted: "label for issues where assignees need help"
#
# The `filtering` section lists labels that, when present on an issue, cause
# the workflow to omit that issue from the update status checks. If an issue
# should be excluded from the update checks (for example, a draft issue), it
# can be labeled with one of the 'filtering' labels and the workflow will skip
# that issue.
#
# The label names shown below are default values only. Each of the label names
# shown **must exactly match an existing label** in your project repo, and must
# be surrounded in quotes. Confirm that the default value is correct, or change
# it to match your repo, then to show that you have reviewed and confirmed the
# values, **delete the comment**.

labels:
required:
statusUpdated: "status: updated"
statusInactive1: "status: to update!"
statusInactive2: "status: 2 weeks inactive"
statusHelpWanted: "status: help wanted"

filtering:
- "draft"
- "epic"
- "dependency"
# - "" # <-- Uncomment and add label name if needed.
# - "" # <-- Uncomment and add label name if needed.

#
# NOTE: the following is only applicable to teams that a.) use Skills Issues
# and b.) **have installed the "Member Activity Trigger" workflow**.
# Currently, the only team this applies to is the Website team.
#
# The `modifying` section defines labels that adjust how the workflow behaves
# under specific conditions. For example, when the automation encounters an
# issue labeled as a Skills Issue, it applies an alternate set of criteria to
# determine the issue’s update status. Additionally, issues in this category
# remain permanently assigned and are not subject to automatic unassignment.
# This allows the workflow to adapt dynamically to different issue types while
# preserving expected behavior for specialized cases.



# ==============================================================================
# Time thresholds (in days)
# ==============================================================================
#
# Each issue's update status is determined by comparing the timestamp of the
# assignee's last update with the time thresholds following. These thresholds
# have been assigned default values as shown below.
#
# ONLY IF NEEDED: You may override the default values to fit your project's needs.
# Note, however, that the following values must be ordered from smallest to largest:
#
# recentlyUpdatedByDays: Issues updated within this many days are considered current
# needsUpdatingByDays: Issues not updated for this many days are prompted for update
# isInactiveByDays: Issues not updated for this many days are marked as inactive
# unassignedByDays: Issues not updated for this many days have assignees removed <-- FUTURE FEATURE
# upperLimitDays: Bot comments older than this not processed for minimization <-- see below

timeframes:
recentlyUpdatedByDays: 3
needsUpdatingByDays: 7
isInactiveByDays: 14
unassignedByDays: 21
upperLimitDays: 35

# To reduce issue clutter and repetition, this workflow minimizes previous bot
# comments via a GraphQL mutation. To limit GitHub GraphQL rate usage, only bot
# comments created between `isInactiveByDays` and `upperLimitDays` ago are
# processed. Adjust this value to include greater or fewer comments.
#
# Refer to "Bot configuration" below to set the bot username (if needed).



# ==============================================================================
# Project Board status-column configuration
# ==============================================================================
#
# The workflow only checks issues that are in the specified `targetStatus`
# status-column of your Project Board. The `questionsStatus` status-column
# allows assignees to opt out of checks when they need help or review.
#
# Values must **exactly match your Project Board status-column names**.
#
# targetStatus: Required for inclusion in update checks
# questionsStatus: Optional; assignees may move issues here to skip checks
# projectNumber: Optional; which Project Board to read the status from
#
# `projectNumber` matters when your issues sit on more than one Project Board. Without it the workflow
# reads the status from whichever board GitHub returns first, which may not be the board this config
# describes- so an issue can be skipped even though it is in the `targetStatus` column of your board.
# Set it to the number in your board's URL: https://github.com/orgs/<org>/projects/<projectNumber>
# Leave it commented out to keep the previous behavior.
#
# The status-column values shown below in "double quotes" are default values
# only. Each of these values **must exactly match an existing status-column**
# in your Project Board. Change each value as needed for an exact match, ensure
# each value is in double quotes, then to show that you have reviewed and
# confirmed the values, **delete the comment**.

projectBoard:
targetStatus: "In progress (actively working)"
questionsStatus: "Questions/Review"
projectNumber: 73




# ==============================================================================
# Bot configuration- If needed
# ==============================================================================
#
# Relevant to "timeframes.upperLimitDays" setting above, repetitive comments
# from bots with the following usernames are processed for minimization. Only
# if needed, this value can be updated to ensure bot comments are minimized.

bots:
- "hfla-graphql-app[bot]"
- "github-actions[bot]"
- "HackforLABot"



# ==============================================================================
# Bot comment template
# ==============================================================================
#
# The reminder text comes from the template file installed alongside this config:
# `github-actions/workflow-configs/templates/add-update-instructions-template.md`
# Edit that file to change what the bot says. Ref. relevant labels, project board status-column
# configuration, etc. above.
#
# Resolution order, highest first:
# 1. `commentTemplate` set below, if you would rather keep the text inline than in its own file
# 2. the template file (see `commentTemplatePath`, only needed if you move or rename it)
# 3. the workflow's built-in default, used when no template file is present
#
# commentTemplatePath: "github-actions/workflow-configs/templates/add-update-instructions-template.md"
#
# commentTemplate: |
# Hello ${assignees}-
# ...
#
# Variables used by template:
# ${assignees} - @-mentions of all assignees (e.g., "@user1, @user2")
# ${label} - The label being applied (e.g., "Status: To Update")
# ${statusUpdated} - The "updated" label name from your label directory
# ${statusHelpWanted} - The "help wanted" label name from your label directory
# ${questionsStatus} - The "questions" status on your Project Board (e.g., "Questions / In Review")
# ${cutoffTime} - The formatted timestamp of the issue's last update

teamSlackChannel: "" # Only if needed, for example "#project-site"



# ==============================================================================
# Advanced options
# ==============================================================================
#
# Local timezone for cutoffTime displayed in comments. (default: America/Los_Angeles)
# Uncomment and configure only if a different timezone is needed.
#
# timezone: "America/Los_Angeles"
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!-- Message template used with the "Add Update Label Weekly" workflow -->
<!-- This file to be installed at: `github-actions/workflow-configs/templates/add-update-instructions-template.md` -->

Hello ${assignees} -

Please add an update using the below template (even if you have a pull request). Afterwards, remove
the `${label}` label and add the `${statusUpdated}` label.

1. Progress: What is the current status of this issue? What have you completed and what is left to do?
2. Blockers: Explain any difficulties or errors encountered.
3. Availability: How much time will you have this week to work on this issue?
4. ETA: When do you expect this issue to be completed?
5. Pictures (optional): Add any pictures of the visual changes made to the site so far.

If you need help, be sure to either: 1) place your issue in the "${questionsStatus}" status-column of the
Project Board and ask for help at your next meeting; 2) put a `${statusHelpWanted}` label on your issue
and pull request; or 3) put up a request for assistance on the team's ${teamSlackChannel} Slack channel.

<sub>You are receiving this comment because your last update was before ${cutoffTime}.</sub>