Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/actions/setup-node…
Browse files Browse the repository at this point in the history
…-4.0.3
  • Loading branch information
mgarbs authored Jan 22, 2025
2 parents ce72edb + 23b9cba commit 01f8213
Show file tree
Hide file tree
Showing 45 changed files with 4,688 additions and 891 deletions.
14 changes: 7 additions & 7 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
# NOTE: Must be placed last to ensure enforcement over all other rules

# Protection Rules for Github Configuration Files and Actions Workflows
/.github/ @hashgraph/release-engineering @hashgraph/release-engineering-managers
/.github/workflows/ @hashgraph/release-engineering @hashgraph/release-engineering-managers @mgarbs
/.github/ @hashgraph/platform-ci @hashgraph/release-engineering-managers
/.github/workflows/ @hashgraph/platform-ci

# Self-protection for root CODEOWNERS files (this file should not exist and should definitely require approval)
/CODEOWNERS @hashgraph/release-engineering @hashgraph/release-engineering-managers @mgarbs
/CODEOWNERS @hashgraph/release-engineering-managers

# Protect the repository root files
/README.md @hashgraph/release-engineering @hashgraph/release-engineering-managers @mgarbs
**/LICENSE @hashgraph/release-engineering @hashgraph/release-engineering-managers
/README.md @hashgraph/platform-ci @hashgraph/release-engineering-managers
**/LICENSE @hashgraph/release-engineering-managers

# Git Ignore definitions
**/.gitignore @hashgraph/release-engineering @hashgraph/release-engineering-managers @mgarbs
**/.gitignore.* @hashgraph/release-engineering @hashgraph/release-engineering-managers @mgarbs
**/.gitignore @hashgraph/platform-ci @hashgraph/release-engineering-managers
**/.gitignore.* @hashgraph/platform-ci @hashgraph/release-engineering-managers
2 changes: 1 addition & 1 deletion .github/workflows/add-hip-number.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ permissions:

jobs:
assign-hip-number:
runs-on: [self-hosted, Linux, medium, ephemeral]
runs-on: improvement-proposals-linux-medium
steps:
- name: Harden Runner
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/notifications.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defaults:

jobs:
DispatchNotifications:
runs-on: [self-hosted, Linux, medium, ephemeral]
runs-on: improvement-proposals-linux-medium
steps:
- name: Harden Runner
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/schedule-last-call-date-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
jobs:
check-merged-file:
if: github.event.pull_request.merged == true
runs-on: [self-hosted, Linux, medium, ephemeral]
runs-on: improvement-proposals-linux-medium

steps:
- name: Check out the code
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/send-discord-message.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ defaults:

jobs:
StatusChangeNotifications:
runs-on: [self-hosted, Linux, medium, ephemeral]
runs-on: improvement-proposals-linux-medium
steps:
- name: Harden Runner
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
Expand All @@ -31,6 +31,6 @@ jobs:
- name: Discord notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD }}
uses: Ilshidur/action-discord@0c4b27844ba47cb1c7bee539c8eead5284ce9fa9 # v0.3.2
uses: step-security/action-discord@a67f622d551a2f5fcc316c78e0076fe665ff6637 # v0.1.0
with:
args: "${{ github.event.inputs.filename }} moved into ${{ github.event.inputs.status }} status https://hips.hedera.com/hip/${{ github.event.inputs.filename }}"
4 changes: 2 additions & 2 deletions .github/workflows/send-email.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ defaults:

jobs:
StatusChangeNotifications:
runs-on: [self-hosted, Linux, medium, ephemeral]
runs-on: improvement-proposals-linux-medium
steps:
- name: Harden Runner
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
with:
egress-policy: audit

- name: Send mail
uses: dawidd6/action-send-mail@2cea9617b09d79a095af21254fbcb7ae95903dde # v3.12.0
uses: step-security/action-send-mail@a995831af980a0a14953f75efec85509f5315e25 # v3.12.0
with:
server_address: smtp.gmail.com
server_port: 465
Expand Down
134 changes: 134 additions & 0 deletions .github/workflows/update-draft-hips.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
name: Update Draft HIPs Data

on:
schedule:
- cron: "0 */6 * * *" # Runs every 6 hours
workflow_dispatch: # Allows manual triggering

jobs:
update-draft-hips:
if: github.ref == 'refs/heads/main' # Only run on main branch
runs-on: improvement-proposals-linux-medium
permissions:
contents: write
pull-requests: read
steps:
- name: Checkout Code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
token: ${{ secrets.GH_ACCESS_TOKEN }}

- name: Import GPG Key
id: gpg_importer
uses: step-security/ghaction-import-gpg@6c8fe4d0126a59d57c21f87c9ae5dd3451fa3cca # v6.1.0
with:
git_commit_gpgsign: true
git_tag_gpgsign: true
git_user_signingkey: true
gpg_private_key: ${{ secrets.GPG_KEY_CONTENTS }}
passphrase: ${{ secrets.GPG_KEY_PASSPHRASE }}

- name: Setup Node.js
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version: "20"

- name: Create Script
run: |
mkdir -p _data
cat << 'EOF' > fetch-draft-hips.js
const https = require('https');
async function makeGraphQLRequest(query, token) {
return new Promise((resolve, reject) => {
const options = {
hostname: 'api.github.com',
path: '/graphql',
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json',
'User-Agent': 'Node.js'
}
};
const req = https.request(options, (res) => {
let data = '';
res.on('data', chunk => { data += chunk; });
res.on('end', () => resolve(JSON.parse(data)));
});
req.on('error', reject);
req.write(JSON.stringify({ query }));
req.end();
});
}
async function getAllPRs() {
const query = `
query {
repository(name: "hedera-improvement-proposal", owner: "hashgraph") {
pullRequests(first: 100, states: [OPEN], orderBy: {field: CREATED_AT, direction: DESC}) {
nodes {
title
number
url
headRefOid
files(first: 100) {
edges {
node {
path
additions
deletions
}
}
}
author {
login
}
}
}
}
}
`;
try {
const result = await makeGraphQLRequest(query, process.env.GITHUB_TOKEN);
if (result.errors) {
console.error('GraphQL errors:', result.errors);
process.exit(1);
}
return result.data.repository.pullRequests.nodes;
} catch (error) {
console.error('Error fetching PRs:', error);
throw error;
}
}
// Run the main function
getAllPRs().then(prs => {
const fs = require('fs');
fs.writeFileSync('_data/draft_hips.json', JSON.stringify(prs, null, 2));
}).catch(error => {
console.error('Failed to fetch PRs:', error);
process.exit(1);
});
EOF
- name: Run Script
run: node fetch-draft-hips.js
env:
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}

- name: Commit and Push Changes
env:
GITHUB_USER_EMAIL: ${{ secrets.GIT_USER_EMAIL }}
GITHUB_USER_NAME: ${{ secrets.GIT_USER_NAME }}
run: |
git config --local user.email "$GITHUB_USER_EMAIL"
git config --local user.name "$GITHUB_USER_NAME"
git add _data/draft_hips.json
git commit -s -S -m "Update draft HIPs data [skip ci]" || echo "No changes to commit"
git push origin main || echo "No changes to push"
2 changes: 1 addition & 1 deletion .github/workflows/validateHeaders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defaults:

jobs:
ValidateHIP:
runs-on: [self-hosted, Linux, medium, ephemeral]
runs-on: improvement-proposals-linux-medium
steps:
- name: Harden Runner
uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1
Expand Down
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ gem 'minima', '~> 2.0'
# If you have any plugins, put them here!
group :jekyll_plugins do
gem 'jekyll-feed', '~> 0.6'
gem 'github-pages'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
Expand Down
Loading

0 comments on commit 01f8213

Please sign in to comment.